// [SerializeField] private AIBehaviorManager _aiManager = null;

    void Awake()
    {
        if (playerStatus == null)
        {
            playerStatus = GetComponentInParent <PlayerStatusHandler>();
        }
    }
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == tagToDetect)
        {
            PlayerStatusHandler status = other.gameObject.GetComponent <PlayerStatusHandler>();

            status.SetHealth(0);
            status.OnPlayerDeath();
        }
    }
示例#3
0
    void Start()
    {
        if (CollectableManager._inst != null)
        {
            cManager = CollectableManager._inst;
        }

        if (pHandler == null)
        {
            pHandler = FindObjectOfType <PlayerStatusHandler>();
        }
    }
    void Awake()
    {
        // Confirm singleton instance is active
        if (_inst == null)
        {
            _inst = this;
            // DontDestroyOnLoad(this);
        }
        else if (_inst != this)
        {
            GameObject.Destroy(this.gameObject);
        }

        if (pStats == null)
        {
            pStats = FindObjectOfType <PlayerStatusHandler>();
        }
    }