You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
using UnityEngine; |
|
using System.Collections; |
|
using AX.MessageSystem; |
|
using AX.TrackRecord; |
|
using System; |
|
|
|
public class ResetbuildingFloor : MonoBehaviour { |
|
|
|
public BuildType buildType = BuildType.TypeA; |
|
void Start () |
|
{ |
|
MessageDispatcher.AddListener("ResetbuildingFloor", Resetbuildingfloor); |
|
MessageDispatcher.AddListener("ResetTheScene", ResetAllbuildingfloor); |
|
} |
|
|
|
private void Resetbuildingfloor(IMessage obj) |
|
{ |
|
MessageDispatcher.SendMessage(buildType,"SELECTFLOOR_EVENT",(object) GetComponent<SELECTFLOOR_EVENT>().floor); |
|
} |
|
private void ResetAllbuildingfloor(IMessage obj) |
|
{ |
|
MessageDispatcher.SendMessage(buildType, "SELECTFLOOR_EVENT", (object)GetComponent<SELECTFLOOR_EVENT>().floor); |
|
MessageDispatcher.SendMessage(buildType,"RESETFLOOR_EVENT", (object)GetComponent<SELECTFLOOR_EVENT>().floor); |
|
if (MySceneManager.GetActiveScene().name.Contains("2")) |
|
{ |
|
var smokeParent = GameObject.Find("TianJinZhan/Smoke").transform;//查找烟雾的位置 |
|
foreach (Transform smoke in smokeParent) |
|
{ |
|
smoke.gameObject.SetActive(false); |
|
} |
|
} |
|
} |
|
|
|
void Update () { |
|
|
|
} |
|
void OnDestroy() |
|
{ |
|
MessageDispatcher.RemoveListener("ResetbuildingFloor", Resetbuildingfloor); |
|
MessageDispatcher.RemoveListener("ResetTheScene", ResetAllbuildingfloor); |
|
} |
|
|
|
|
|
}
|
|
|