public void Awake() { healthPts = healthCapacity; numberOfHurtColliders = 0; controller = gameObject.GetComponent <TopDownPlayerController>(); }
// Start is called before the first frame update void Start() { controller = gameObject.GetComponent <TopDownPlayerController>(); anim = gameObject.GetComponent <Animator>(); rb = gameObject.GetComponent <SimpleRigidbody>(); anim.SetFloat(DirectionXHash, rb.GetDirection().x); anim.SetFloat(DirectionYHash, rb.GetDirection().y); }
void Start() { _weaponCtrl = GetComponent <WeaponController>(); _playerCtrl = GetComponent <TopDownPlayerController>(); _invMgr = GetComponent <InventoryManager>(); // Subscribe to player events _playerCtrl.Interacted += HandleInteraction; _playerCtrl.ShowInventory += ShowInventory; }
public State state;//I added states for our ai private void Start() { playerController = player.GetComponent <TopDownPlayerController>(); NextState(); }
// Start is called before the first frame update void Start() { rb = gameObject.GetComponent <SimpleRigidbody>(); controller = gameObject.GetComponent <TopDownPlayerController>(); anim = gameObject.GetComponent <Animator>(); }
public List <Interactable> interactables = new List <Interactable>(); //Should ideally be switched for a LinkedList or other more efficient insertion/removal data structure void Start() { controller = GetComponent <TopDownPlayerController>(); }
void Start() { WorldGenerator = gameObject.GetComponent<WorldGenerator> (); PlayerController = gameObject.GetComponent<TopDownPlayerController> (); Timer = gameObject.GetComponent<Timer> (); NextLevelMessage = Instantiate (PreFabNextLevelMessage) as GameObject; StartMessage = Instantiate (PreFabStartMessage) as GameObject; TitleMessage = Instantiate (PreFabTitleMessage) as GameObject; GameOverMessage = Instantiate (PreFabGameOverMessage) as GameObject; HideAllMessages (); ShowTitleText (); }