Exemple #1
0
    void Awake()
    {
        mpItemSpawn  = FindObjectOfType <Class_ItemSpawn>();
        mpEnemySpawn = FindObjectOfType <Class_EnemyJon>();
        mpPlayScene  = FindObjectOfType <Class_PlayScene>();

        mpWizard          = this.GetComponentInChildren <Class_Wizard>();
        mpWarrior         = this.GetComponentInChildren <Class_Warrior>();
        mpReceiveWizard   = this.GetComponentInChildren <Class_ReceiveWizard>();
        mpReceiveWarrior  = this.GetComponentInChildren <Class_ReceiveWarrior>();
        mpPlayerUI        = this.GetComponentInChildren <Class_PlayerUI>();
        mpReceivePlayerUI = this.GetComponentInChildren <Class_ReceivePlayerUI>();

        Destroy(mpReceivePlayerUI);

        if (Class_NetworkClient.GetInst().mMyUserInfo.mOccupation == "Warrior")
        {
            Destroy(mpWizard.gameObject);
            Destroy(mpReceiveWarrior);
        }
        else
        {
            Destroy(mpWarrior.gameObject);
            Destroy(mpReceiveWizard);
        }
    }
    void Awake()
    {
        mpReceiveWizard   = this.GetComponentInChildren <Class_ReceiveWizard>();
        mpReceiveWarrior  = this.GetComponentInChildren <Class_ReceiveWarrior>();
        mpWizard          = this.GetComponentInChildren <Class_Wizard>();
        mpWarrior         = this.GetComponentInChildren <Class_Warrior>();
        mpPlayerUI        = this.GetComponentInChildren <Class_PlayerUI>();
        mpReceivePlayerUI = this.GetComponentInChildren <Class_ReceivePlayerUI>();

        Destroy(mpPlayerUI);

        string tOtherPlayerOccupation = "";

        foreach (var u in Class_NetworkClient.GetInst().mUserInfoes)
        {
            if (u.mUserName != Class_NetworkClient.GetInst().mMyUserInfo.mUserName)
            {
                tOtherPlayerOccupation = u.mOccupation;
            }
        }

        if (tOtherPlayerOccupation == "Warrior")
        {
            Destroy(mpReceiveWizard.gameObject);
            Destroy(mpWarrior);
        }
        else
        {
            Destroy(mpReceiveWarrior.gameObject);
            Destroy(mpWizard);
        }
    }