Esempio n. 1
0
 virtual protected void Start() {
     Navigation = GetComponent<NavMeshAgent>();
     GameObject PlayerObject = GameObject.FindGameObjectWithTag("Player");
     PlayerController = PlayerObject.GetComponent<ControllableCharacterController>();
     PlayerTransform = PlayerObject.GetComponent<Transform>();
     ChangeState(ActionState);
 }
Esempio n. 2
0
File: HUD.cs Progetto: EgoTeam/Ego
 void Start()
 {
     _health = GameObject.FindGameObjectWithTag("Health Bar").GetComponent<Image>();
     _loaded = GameObject.FindGameObjectWithTag("Loaded Ammo Bar").GetComponent<Image>();
     _remain = GameObject.FindGameObjectWithTag("Reserve Ammo Bar").GetComponent<Image>();
     _player = GameObject.FindGameObjectWithTag("Player").GetComponent<ControllableCharacterController>();
     _inventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
 }
 // Use this for initialization
 void Awake() {
     _controller = GetComponent<ControllableCharacterController>();
     rigidbody = GetComponent<Rigidbody>();
     ///capsuleCollider = GetComponent<CapsuleCollider>();
     cameraTransform = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Transform>();
     rigidbody.freezeRotation = true;
     rigidbody.useGravity = false;
     //Controller.State.IsGrounded = false;
 }