public override void Act() { base.Act(); ItemInteractor itemInteractor = command.Door.GetComponent <ItemInteractor>(); if (itemInteractor != null) { itemInteractor.AddItem(command.RequiredKey) .Done(() => { command.Execute(); ActionDone(); }); } else { command.Execute(); ActionDone(); } // TODO: trigger events }
/// <summary> /// Method called before the first frame update /// </summary> void Start() { dH = gameObject.GetComponent <MixedDataHolder>(); iI = gameObject.GetComponent <ItemInteractor>(); iI.addData += AddItemToScale; }