/// <summary> /// Raises the trigger enter event. /// </summary> /// <param name="other">Other.</param> void OnTriggerEnter(Collider other) { Airship_Player player = other.GetComponent <Airship_Player> (); if (player != null) { RoomController.Instance.OnHitRoomTrigger(m_direction); GetComponent <Collider> ().enabled = false; } }
// Use this for initialization void Start() { GameManager.instance.InGameController = this; // Get the airship prefab from scriptable. GameObject gobj = GameManager.instance.Data.GetCurrentAirshipPrefab(GameManager.instance.Data.GetCurrentAirshipName()); if (gobj != null) { this.airship = (GameObject.Instantiate(gobj, this.playerStartPoint.position, Quaternion.identity) as GameObject).GetComponent <Airship_Player>(); } if (this.airship == null) { Debug.Log("airship not found"); } else { this.cm.SetTarget(this.airship.transform); } // Disable move target gobj. this.moveTargetGobj.SetActive(false); // Initialize boundaries. this.bounds = new Bounds(Vector3.zero, new Vector3(95f, 0, 95f)); // Get characters that are currently in airship. this.charactersInAirship = new PartyCharacter[GameManager.instance.Data.GetCharactersInAirship().Length]; for (int i = 0; i < this.charactersInAirship.Length; i++) { int inventoryNum = GameManager.instance.Data.GetCharactersInAirship()[i]; // Create character. PartyCharacter c = this.CreateNewPartyCharacter(inventoryNum); // Assign character and ability to visual component. this.pmc.SetPartyCharacter(c, i); this.charactersInAirship[i] = c; this.igm.SetCharOnDeck(i, c.Icon); } // Get characters on standby in the airship. this.charactersStandbyInAirship = new PartyCharacter[GameManager.instance.Data.GetCharactersStandbyInAirship().Length]; for (int i = 0; i < this.charactersStandbyInAirship.Length; i++) { int inventoryNum = GameManager.instance.Data.GetCharactersStandbyInAirship()[i]; // Create character. PartyCharacter c = this.CreateNewPartyCharacter(inventoryNum); // Store in standby array. this.charactersStandbyInAirship[i] = c; this.igm.SetCharOnStandby(i, c.Icon); } this.mc.SetMission(GameManager.instance.Data.GetCurrentMission()); this.mc.CloseMenu(); this.igm.gameObject.SetActive(false); }