Пример #1
0
 public Unit(Game game, eTeam team)
     : base(game)
 {
     m_Legs = new GameObject[2];
     for (int i = 0; i < m_Legs.Length; i++)
     {
         m_Legs[i] = new GameObject(game);
     }
     m_Team = team;
     m_ModelRotation = Quaternion.Concatenate(Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), (float)Math.PI / 2), Quaternion.CreateFromAxisAngle(new Vector3(0, 0, 1), (float)Math.PI));
     ShootTime = 10000;
     m_Health = MaxHealth;
     m_SpawnTime = 0;
     m_DieTime = 0;
     TimeUntilPathExpire = 0;
     Flying = false;
     m_FlyingState = false;
     foreach (GameObject leg in m_Legs)
     {
         GameState.Get().SpawnGameObject(leg);
     }
 }
Пример #2
0
 private void SwitchFirstTeam()
 {
     if (firstTeam == eTeam.TEAM_BLUE) {
         firstTeam = eTeam.TEAM_RED;
     } else {
         firstTeam = eTeam.TEAM_BLUE;
     }
 }
Пример #3
0
    private void GiveWinningTeamPoints( eTeam team, int points )
    {
        switch ( team ) {
            case eTeam.TEAM_RED:{
                team1score += points;
                team1currentscore += points;
                break;
            }

            case eTeam.TEAM_BLUE:{
                team2score += points;
                team2currentscore += points;
                break;
            }
        }
    }
Пример #4
0
    private void GivePoints( eTeam winningTeam, float enemyDistanceFromBullseye )
    {
        int points = 0;

        foreach ( Rock rock in FindObjectsOfType<Rock>() ) {
            if ( rock.team == winningTeam ) {
                if ( rock.DistanceFromBullseye() < enemyDistanceFromBullseye ) {
                    points++;
                }
            }
        }

        GiveWinningTeamPoints( winningTeam, points );
    }
Пример #5
0
    private float GetEnemyClosestToBullseye( eTeam winningTeam )
    {
        float closestToBullseye = 99999.9f;
        foreach ( Rock rock in FindObjectsOfType<Rock>() ) {
            if ( rock.team != winningTeam ) {
                if ( rock.DistanceFromBullseye() < closestToBullseye ) {
                    closestToBullseye = rock.DistanceFromBullseye();
                }
            }
        }

        return closestToBullseye;
    }
Пример #6
0
 protected virtual void addToTeam(PlayerController pc, eTeam team)
 {
 }
Пример #7
0
    public void SetPositionAndTeam(Vector3 iPosition, eTeam iTeam)
    {
        StartPosition = iPosition;
        Position = iPosition;
        rigidbody.position = iPosition;
        Team = iTeam;
        if (Team == eTeam.Blue)
        {
            Dwarf.transform.FindChild("head_geo").renderer.material = BlueSkin;
            Dwarf.transform.FindChild("body").renderer.material = BlueSkin;

            UnityLightLightOnly.color = new Color(0.5f, 0.5f, 0.8f, 1.0f);
            UnityLight.color = new Color(0.5f, 0.5f, 0.8f, 1.0f);
            TeamNumber = 0;
        }
        else
        {
            Dwarf.transform.FindChild("head_geo").renderer.material = RedSkin;
            Dwarf.transform.FindChild("body").renderer.material = RedSkin;

            UnityLightLightOnly.color = new Color(0.8f, 0.5f, 0.5f, 1.0f);
            UnityLight.color = new Color(0.8f, 0.5f, 0.5f, 1.0f);
            TeamNumber = 1;
        }
        UnityLightLightOnly.shadows = LightShadows.None;
        UnityLight.shadows = LightShadows.Soft;
        LightOn = false;
        HasFlag = false;
        IsDead = false;
    }
 public SpawnPoint(Game game, eTeam t)
     : base(game)
 {
     team = t;
     name = "SpawnPoint"+t;
 }