예제 #1
0
파일: CaptureZone.cs 프로젝트: tek-f/MyFPS
        //private void Start()
        //{
        //    //gameModeCTF = GameObject.FindWithTag("GameManager").GetComponent<GameModeCTF>();

        //    if (gameModeCTF == null)
        //    {
        //        Debug.LogError("Could not fund GameModeCTF");
        //    }
        //}
        private void OnTriggerEnter(Collider other)
        {
            PlayerHandler player = other.GetComponent <PlayerHandler>();

            if (player != null)
            {
                //if (player.GetWeaponTeamID() != teamID)
                //{
                //    return;
                //}
                if (player.IsHoldingFlag && player.teamID == teamID)
                {
                    player.CmdUpdateTeamScores(teamID);
                    player.ReturnFlag();
                    ResetFlag();
                }
            }
        }