///<summary> ///initialize using associated entity ///</summary> ///<param name="entity">associated entity</param> public void Initialize(Entity entity) { _triggerOnButtonSendMsg = entity as TriggerOnButtonSendMsg; SetClosed(); Layer = 30; IsTemplate = false; Size = new Vector2(16, 16); }
///<summary> ///Add a door trigger using given door trigger data ///</summary> ///<param name="doorTriggerData"></param> public void AddDoorTrigger(DoorTriggerData doorTriggerData) { TriggerOnButtonSendMsg tr = new TriggerOnButtonSendMsg(doorTriggerData); TriggerSystem.Register(tr); //register the entity EntityManager.Instance.RegisterEntity(tr); }