-
Notifications
You must be signed in to change notification settings - Fork 0
/
BTN_choose_titan.cs
64 lines (60 loc) · 3.59 KB
/
BTN_choose_titan.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Decompiled with JetBrains decompiler
// Type: BTN_choose_titan
// Assembly: Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
using ExitGames.Client.Photon;
using System.Collections.Generic;
using UnityEngine;
public class BTN_choose_titan : MonoBehaviour
{
private void OnClick()
{
switch (IN_GAME_MAIN_CAMERA.gamemode)
{
case GAMEMODE.PVP_AHSS:
string id = "AHSS";
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[0], true);
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().needChooseSide = false;
if (!PhotonNetwork.isMasterClient && (double) GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().roundTime > 60.0)
{
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().NOTSpawnPlayer(id);
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().photonView.RPC("restartGameByClient", PhotonTargets.MasterClient);
}
else
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().SpawnPlayer(id, "playerRespawn2");
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[1], false);
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[2], false);
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[3], false);
IN_GAME_MAIN_CAMERA.usingTitan = false;
GameObject.Find("MainCamera").GetComponent<IN_GAME_MAIN_CAMERA>().setHUDposition();
Hashtable propertiesToSet = new Hashtable();
((Dictionary<object, object>) propertiesToSet).Add((object) PhotonPlayerProperty.character, (object) id);
PhotonNetwork.player.SetCustomProperties(propertiesToSet);
return;
case GAMEMODE.PVP_CAPTURE:
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().checkpoint = GameObject.Find("PVPchkPtT");
break;
}
string selection = GameObject.Find("PopupListCharacterTITAN").GetComponent<UIPopupList>().selection;
NGUITools.SetActive(((Component) ((Component) this).transform.parent).gameObject, false);
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[0], true);
if (!PhotonNetwork.isMasterClient && (double) GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().roundTime > 60.0 || GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().justSuicide)
{
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().justSuicide = false;
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().NOTSpawnNonAITitan(selection);
}
else
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().SpawnNonAITitan2(selection);
GameObject.Find("MultiplayerManager").GetComponent<FengGameManagerMKII>().needChooseSide = false;
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[1], false);
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[2], false);
NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent<UIReferArray>().panels[3], false);
IN_GAME_MAIN_CAMERA.usingTitan = true;
GameObject.Find("MainCamera").GetComponent<IN_GAME_MAIN_CAMERA>().setHUDposition();
}
private void Start()
{
if (LevelInfo.getInfo(FengGameManagerMKII.level).teamTitan)
return;
((Component) this).gameObject.GetComponent<UIButton>().isEnabled = false;
}
}