public void Awake()
    {
        healthPts             = healthCapacity;
        numberOfHurtColliders = 0;

        controller = gameObject.GetComponent <TopDownPlayerController>();
    }
Esempio n. 2
0
 // 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);
 }
Esempio n. 3
0
    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();
    }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     rb         = gameObject.GetComponent <SimpleRigidbody>();
     controller = gameObject.GetComponent <TopDownPlayerController>();
     anim       = gameObject.GetComponent <Animator>();
 }
Esempio n. 6
0
 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>();
 }
Esempio n. 7
0
    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 ();
    }