/// <summary>
		/// Deactivate this instance.
		/// </summary>
		
		public override void Deactivate() {

			if (_active = this) {
								_active = null;
						}
            
			// Disable the Character Controller so that the PC cannot fall infinitely 
			CharacterController charCont = this.GetComponent<CharacterController> ();
			if(charCont != null){
				charCont.enabled = false;
			}
			else {
				Debug.LogError("The character controller on your Player Character " + this.Key + " is not attached. Please attach");
			}

			// Hide the instance
			// Hide ();
			DisablePlayerControl ();
		}
		public void SetPlayerCharacter(PlayerCharacter pc) {
		
			_activeCharacter = pc;

		}
		public void Activate(PlayerCharacter pc) {
		
			if (pc != null) {
								pc.Activate ();
						}
		
		}
		/// <summary>
		/// Adds the PC to list of all player characters.
		/// </summary>
		/// <param name="item">Item.</param>

		public void AddPCToList(PlayerCharacter item) {

			_playerCharacters.Add (item);
			
		}
예제 #5
0
		void Start() {


			if (_instance == null) {

				_editorActivated = true;

				// Set the singleton instance to this
					_instance = this;
			
					// Get the active pc
					foreach (PlayerCharacter pc in GameObject.FindObjectsOfType<PlayerCharacter>()) {
				
							if (pc.Key == _activePCKey) {
				
									if(_setPCSceneTo != null && _setPCSceneTo != "") {
										pc.ChangeScene(_setPCSceneTo);
									}
								
									// Set the active character
									GameController.PartyManager.SetPlayerCharacter (pc);
									_activePC = pc;
					
					
							}
				
					}
			
			
			
			
			
					// Activate the PC | Do I need this?
					ActivatePC ();
			
			
					// Activate the spawn point
					ActivateSpawn ();

				}

		}