GetTeam() 공개 메소드

public GetTeam ( ) : int
리턴 int
예제 #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);
    }
예제 #2
0
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        if (singleton == null)
        {
            return;
        }

        if (!login)
        {
            if (pCommmon.GetTeam() == 2)
            {
                DemoMgr.singleton.Set2pComps();
                login = true;
            }
        }
    }