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.
36 lines
857 B
36 lines
857 B
using AX.MessageSystem; |
|
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class WaterCurtainControl : CloneGameObjInfo { |
|
|
|
public override void Awake() |
|
{ |
|
base.Awake(); |
|
gameObjType = CloneObjType.CurtainLine; |
|
gameObject.SetActive(false); |
|
MessageDispatcher.AddListener("ControlWaterCurtain", ControlCurtain); |
|
} |
|
|
|
private void ControlCurtain(IMessage obj) |
|
{ |
|
var data = (CurtainData)obj.Data; |
|
if (data.id == this.gameObjID) |
|
{ |
|
gameObject.SetActive(data.on); |
|
} |
|
} |
|
|
|
public override void OnDestroy() |
|
{ |
|
base.OnDestroy(); |
|
MessageDispatcher.RemoveListener("ControlWaterCurtain", ControlCurtain); |
|
} |
|
} |
|
public class CurtainData |
|
{ |
|
public long id; |
|
public bool on; |
|
} |