コード例 #1
0
ファイル: PickableItem.cs プロジェクト: anly2/unity-maze-warp
    protected virtual void Activate()
    {
        if (acting) //avoid infinite recursion
        {
            return;
        }

        acting = true;

        ActionHistory.Action activation = null;
        activation = delegate(GameObject actor)
        {
            CarriedItem  slot = actor.GetComponent <CarriedItem>();
            PickableItem item = slot.carriedItem;

            item.Activate();
            return(false);
        };

        activation(slotTaken.gameObject);
        slotTaken.gameObject.GetComponent <Movement>().actionHistory.Add(activation);

        acting = false;
    }