PlayerCommon.GetTeam C# (CSharp) Method

GetTeam() public method

public GetTeam ( ) : int
return int
    public int GetTeam()
    {
        return team ;
    }

Usage Example

Example #1
0
    public void CmdMakeMob()
    {
        Vector3    StartPos = Vector3.zero;
        Vector3    EndPos   = Vector3.zero;
        GameObject colorGo  = mobBlue;

        if (pCommmon.GetTeam() == 1)
        {
            StartPos = DemoMgr.singleton.targetPosBlue.position;
            EndPos   = DemoMgr.singleton.targetPosRed.position;
            colorGo  = mobBlue;
        }

        else if (pCommmon.GetTeam() == 2)
        {
            StartPos = DemoMgr.singleton.targetPosRed.position;
            EndPos   = DemoMgr.singleton.targetPosBlue.position;
            colorGo  = mobRed;
        }

        GameObject mobGo = (GameObject)GameObject.Instantiate(colorGo, StartPos, Quaternion.identity);

        NavMeshAgent nma = mobGo.GetComponent <NavMeshAgent>();

        nma.destination = EndPos;
        GameObject.Destroy(mobGo, 10.0f);
        mobGo.GetComponent <MobServer>().InitData(pCommmon.GetTeam());
        NetworkServer.Spawn(mobGo);
    }
All Usage Examples Of PlayerCommon::GetTeam