示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        player = this.transform.parent.gameObject;

        playerName.text = playersName + " " + player.GetComponent <PlayerController>().playerControllerID;

        player.GetComponentInChildren <CatCollider>().DelegateChaser += OnBecameChaser;
        SceneManager.sceneLoaded += OnSceneLoaded;
        catEnergy = player.GetComponent <CatEnergy>();

        countdown.gameObject.SetActive(false);
        //playerName = header.transform.Find("Name").GetComponent<Text>();
        //countdown = header.transform.Find("Countdown").GetComponent<Text>();
        //score = header.transform.Find("Score").GetComponent<Text>();
    }
示例#2
0
    private void OnTriggerEnter(Collider other)
    {
        if (!canBePicked || other.gameObject.tag != "TouchCollider")
        {
            return;
        }

        GameObject otherEntity = other.transform.parent.gameObject;
        eCatState  otherState  = otherEntity.GetComponent <CatState>().currentState;

        if (otherState == eCatState.CHASED)
        {
            CatEnergy energy = otherEntity.GetComponent <CatEnergy>();
            energy.RefillTime(timeRefill);
            DeActivate();
        }
    }