예제 #1
0
    void hprDeployShieldAt(Vector3 position, Vector3 dirLook)
    {
        var shield = Instantiate(m_shield);

        shield.transform.position = position;
        shield.transform.LookAt(position + dirLook);
        PhysicsLayer.SET_SHIELD(shield, m_team);
    }
예제 #2
0
    public static Transform SPAWN(PREFAB_ID id, GameData.TEAM team)
    {
        switch (id)
        {
        case PREFAB_ID.MONK_PUNCH_SHIELD:
            var monkPunchShield = Instantiate <Prefab>(ME.PRF_MONK_PUNCH_SHIELD);
            PhysicsLayer.SET_SHIELD(monkPunchShield, team);
            monkPunchShield.gameObject.name = "MONK PUNCH SHIELD";
            hprSetShieldColor(monkPunchShield, team);
            return(monkPunchShield.transform);

        case PREFAB_ID.MONK_PUNCH:
            var punch = Instantiate <Prefab>(ME.PRF_MONK_PUNCH);
            hprSetTeamColor(punch, team);
            return(punch.transform);

        case PREFAB_ID.ROCKET:
            var rocket = Instantiate <Prefab>(ME.PRF_ROCKET);
            hprSetTeamColor(rocket, team);
            return(rocket.transform);

        case PREFAB_ID.GRENADE:
            var grenade = Instantiate <Prefab>(ME.PRF_GRENADE);
            if (team == GameData.TEAM.RED)
            {
                grenade.setMaterial(ME.MAT_TEAM_RED);
            }
            else
            {
                grenade.setMaterial(ME.MAT_TEAM_BLUE);
            }
            return(grenade.transform);

        case PREFAB_ID.ROCKET_EXPLOSION:
            if (team == GameData.TEAM.RED)
            {
                return(Instantiate(ME.PRF_ROCKET_EXPLOSION_RED).transform);
            }
            return(Instantiate(ME.PRF_ROCKET_EXPLOSION_BLUE).transform);

        case PREFAB_ID.GREANDE_EXPLOSION:
            if (team == GameData.TEAM.RED)
            {
                return(Instantiate(ME.PRF_GRENADE_EXPLOSION_RED).transform);
            }
            return(Instantiate(ME.PRF_GRENADE_EXPLOSION_BLUE).transform);
        }
        return(null);
    }
예제 #3
0
 public void init(GameData.TEAM team)
 {
     PhysicsLayer.SET_ATTACK(m_prfAttack, team);
     PhysicsLayer.SET_SHIELD(m_prfShield, team);
 }