コード例 #1
0
ファイル: Saw.cs プロジェクト: Turmolt/TheGardener
 public override void Use(GrabbableObject bp)
 {
     if (bp.GetType() == (typeof(BodyPart)) || bp.GetType().IsSubclassOf(typeof(BodyPart)))
     {
         bp.AsBodyPart().Harvest();
     }
 }
コード例 #2
0
ファイル: BodyPart.cs プロジェクト: Turmolt/TheGardener
 public override void Use(GrabbableObject g)
 {
     if (g.GetType() == typeof(Blender))
     {
         player.DropHolding(false);
         ((Blender)g).Use(this);
         Debug.Log("VVVRRRRRRRR");
     }
 }
コード例 #3
0
ファイル: Blender.cs プロジェクト: Turmolt/TheGardener
 public override void Use(GrabbableObject o)
 {
     if (!o.GetType().IsSubclassOf(typeof(BodyPart)) || ((BodyPart)o).IsPlanted || currentValue == maxValue)
     {
         return;
     }
     sfx.PlayAudio(sfx.Blend);
     currentValue = currentValue.AddClamped(o.AsBodyPart().Value, 0f, maxValue);
     RefreshBlenderFill();
     Destroy(o.gameObject);
 }