///sets every component in the Connector to null, ///to allow garbage collecting of referenced objects public static void DeAllocate() { playerControllerToLink = null; HealthBar = null; TimeBar = null; EnergyBar = null; }
/// <summary> /// ロボットを生成する処理 /// </summary> void GenerateRobot() { this.prefab = Instantiate(player, createPos, Quaternion.identity); this.playerController = prefab.GetComponent <TestPlayerController>(); this.playerController._StageMgr = this.gameObject.GetComponent <TestStageMgr>(); this.playerController._ThirdPersonCamera.SetActive(true); }
public static void AllocateGUICameraListener(TestPlayerController player) { isUsed = true; playerControllerToLink = player; if (cameraCanvas != null) { AllocateGUICameraListener(cameraCanvas); } }
///precondition: player != null ///stores PlayerController to link with eventual Sliders, or links PlayerController with Sliders if they are available public static void AllocatePlayerGUILink(TestPlayerController player) { playerControllerToLink = player; isUsed = true; //if we already have health,time,energy bars ready, connect them to player if (HealthBar != null && TimeBar != null && EnergyBar != null) { playerControllerToLink = player; AllocatePlayerGUILink(HealthBar, TimeBar, EnergyBar); } }
public void Setup() { playerController = playerObj.GetComponent<TestPlayerController>(); n_Player = playerObj.GetComponent<TestNetworkPlayer>(); n_Player.playerName = playerName; }