private void Awake() { if (Instance) { Destroy(this); } else { Instance = this; } }
void Start() { sceneManager = GetComponent <PlayerSceneManager>(); isOpen = false; resourceIndex = 0; currentView = backpackPart1; firstView = true; }
void Start() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else { Debug.Log("Error: Duplicated " + this + "in the scene"); } }
void Start() { currentIndex = -1; sceneManager = GetComponent <PlayerSceneManager>(); inGameManager = GetComponent <InGameDataManager>(); equipment = new Equipment[5]; //equipment[0] = weapons[(int)WeaponType.AR]; equipment[0] = weapons[(int)WeaponType.Pistol]; //weaponCounts[(int)WeaponType.AR]++; weaponCounts[(int)WeaponType.Pistol]++; resources = new List <ResourcePersistent>(); resourceSet = new HashSet <Resource>(); }
void Awake() { GameObject[] objs = GameObject.FindGameObjectsWithTag("GameController"); foreach (var obj in objs) { if (obj.GetPhotonView().Owner.UserId == photonView.Owner.UserId) { playerController = obj; baseDataManager = obj.GetComponent <BaseDataManager>(); inGameDataManager = obj.GetComponent <InGameDataManager>(); sceneManager = obj.GetComponent <PlayerSceneManager>(); skillManager = obj.GetComponent <SkillManager>(); } } sceneManager.isInHomeBase = false; GameControllerSingleton.instance.aliveCount = PhotonNetwork.CurrentRoom.PlayerCount; }