示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        var _competitor = other.gameObject.GetComponent <Competitor>();

        if (other.tag == "Player")
        {
            goal = true;
        }
        if (other.tag == "Enemy")
        {
            goalName = other.GetComponent <Competitor>().name;
        }

        if (_competitor)
        {
            pointTracker           = _competitor.GetComponentInParent <PointTracker>();
            point                  = pointTracker.PointVal();
            _competitor.ScoredGoal = true;
            _competitor.GetComponentInParent <Crown>().resetCrown();
            pointTracker.ResetMult();
            pointTracker.ResetBasePoints();
            scoreManager.UpdateScore(_competitor.Name, (int)point);
            StartCoroutine(spawnPointManager.RespawnTimer(_competitor.Name));
            StartCoroutine(spawnPointManager.PauseRigidBodyControl(_competitor, 2f));
            StartCoroutine(spawnPointManager.PauseCamera(_competitor));
            Explosion();
        }
    }