예제 #1
0
    void setTeam(TEAM team)
    {
        if (team == TEAM.NULL)
        {
            Debug.LogWarning("WARNING : TEAM cannot be set to null");
            return;
        }

        _team = team;
        foreach (Transform c in GetComponentsInChildren <Transform>())
        {
            if (c.GetComponent <DamagingPoint> () != null)
            {
                c.gameObject.layer = LayerHelper.GetAttackBoxLayer(team);
                c.GetComponent <DamagingPoint> ().SetDamagableLayers();
            }
            if (c.GetComponent <Hitbox> () != null)
            {
                c.gameObject.layer = LayerHelper.GetHitboxLayer(team);
            }
        }
        if (GetComponent <CharacterMovementHandler> () != null)
        {
//			print ("team : " + team);
            GetComponent <CharacterMovementHandler> ().SetLayerMask(LayerHelper.GetLayerMask(team));
        }
    }