using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class recurso : MonoBehaviour {
int id;
bool dentrodelradio;
public bool apuntando;
void OnTriggerEnter(Collider other){
if (other.gameObject.name == "recurso")
dentrodelradio = true;
else dentrodelradio = false;
}
// Use this for initialization
void Start () {
if (this.gameObject.CompareTag("arbol")) {
int id = 1;
}
else if (this.gameObject.CompareTag("carne")) {
int id = 2;
}
}
// Update is called once per frame
void Update () {
if (dentrodelradio){
switch(id){
case 1:
transform.this.gameObject.tag = "arbolactivo";
case 2:
transform.this.gameObject.tag = "carneactivo";
}
if (apuntando){
if (Input.GetMouseButton(0)){
//ir cambiando la textura con un time delta time y un switch.
}
}
}
}
}
↧
Hi, getting error cs1041 in my code:identifier expected, "this" is a keyword; need solution please
↧