protected override void HandleCommand(ChestSwitchCommand chstSwtchCmnd) { if (focousedChest == null) //there's no focused chest { foreach (GameObject obj in collidesWithNow) { if (obj is Chest) { focousedChest = obj as Chest; focousedChest.SwitchChestState(); //open it break; } } } else //there's a focused chest { focousedChest.SwitchChestState(); //close it focousedChest = null; } }
protected virtual void HandleCommand(ChestSwitchCommand chstSwtchCmnd) { }