getTeam() { if (Team == null) { Team = GetComponentInParent <ArenaTeam>(); } return(Team); }
TrigEvent(GameObject other) { bool IsTrig = false; // take effect when other is of TrigTags foreach (string Tag_ in TrigTags) { if (other.CompareTag(Tag_)) { IsTrig = true; break; } } if (IsTrig) { if (KillType == KillTypes.ArenaTeam) { ArenaTeam OtherArenaTeam_ = other.GetComponentInParent <ArenaTeam>(); if (TeamIDToMatch == -1) { // } else if (TeamIDToMatch >= 0) { if (OtherArenaTeam_.getTeamID() != TeamIDToMatch) { return; } } else { Debug.LogError("Invalid TeamIDToMatch"); } globalManager.KillTeam(OtherArenaTeam_.getTeamID()); } else if (KillType == KillTypes.ArenaAgent) { ArenaAgent OtherArenaAgent_ = other.GetComponentInParent <ArenaAgent>(); if (TeamIDToMatch == -1) { // } else if (TeamIDToMatch >= 0) { if (OtherArenaAgent_.getTeamID() != TeamIDToMatch) { return; } } else { Debug.LogError("Invalid TeamIDToMatch"); } if (AgentIDToMatch == -1) { // } else if (AgentIDToMatch >= 0) { if (OtherArenaAgent_.getAgentID() != AgentIDToMatch) { return; } } else { Debug.LogError("Invalid AgentIDToMatch"); } globalManager.KillAgent(OtherArenaAgent_.getTeamID(), OtherArenaAgent_.getAgentID()); } } } // TrigEvent