Code
using UnityEngine;
using System.Collections;
public class _bat : MonoBehaviour {
public GameObject player;
void Update (){
if ( Input.GetMouseButtonDown (0) )
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray, out hit, Mathf.Infinity))
{
if(hit.collider.name == "batar")
{
svet_ Ener = player.GetComponent<svet_>();
Ener.Energe+=10;
Destroy (this.gameObject);
}
}
}
}
}
ругается на эту строчку
Code
svet_ Ener = player.GetComponent<svet_>();
The type or namespace name `svet_' could not be found. Are you missing a using directive or an assembly reference? вот что ему не нравится?