Browse Source

Added ShowSprite command. Moved mushroom sprites to FungusScript

master
chrisgregan 10 years ago
parent
commit
0b3b23d7c6
  1. 0
      Assets/Fungus/FungusScript/Sprites.meta
  2. 0
      Assets/Fungus/FungusScript/Sprites/Mushroom.png
  3. 0
      Assets/Fungus/FungusScript/Sprites/Mushroom.png.meta
  4. 0
      Assets/Fungus/FungusScript/Sprites/ScriptIcon32.png
  5. 0
      Assets/Fungus/FungusScript/Sprites/ScriptIcon32.png.meta
  6. 2
      Assets/Fungus/Sprite/Commands/FadeSprite.cs
  7. 43
      Assets/Fungus/Sprite/Commands/ShowSprite.cs
  8. 8
      Assets/Fungus/Sprite/Commands/ShowSprite.cs.meta
  9. BIN
      Assets/Shuttle/ShuttleGame.unity

0
Assets/Fungus/Sprite/Sprites.meta → Assets/Fungus/FungusScript/Sprites.meta

0
Assets/Fungus/Sprite/Sprites/Mushroom.png → Assets/Fungus/FungusScript/Sprites/Mushroom.png

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
Assets/Fungus/Sprite/Sprites/Mushroom.png.meta → Assets/Fungus/FungusScript/Sprites/Mushroom.png.meta

0
Assets/Fungus/Sprite/Sprites/ScriptIcon32.png → Assets/Fungus/FungusScript/Sprites/ScriptIcon32.png

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

0
Assets/Fungus/Sprite/Sprites/ScriptIcon32.png.meta → Assets/Fungus/FungusScript/Sprites/ScriptIcon32.png.meta

2
Assets/Fungus/Sprite/Commands/FadeSprite.cs

@ -10,7 +10,7 @@ namespace Fungus.Script
public class FadeSprite : FungusCommand
{
public SpriteRenderer spriteRenderer;
public float duration;
public float duration = 1f;
public Color targetColor = Color.white;
public bool waitUntilFinished = true;

43
Assets/Fungus/Sprite/Commands/ShowSprite.cs

@ -0,0 +1,43 @@
using UnityEngine;
using System;
using System.Collections;
namespace Fungus.Script
{
[CommandInfo("Sprite",
"Show Sprite",
"Makes a sprite visible / invisible by setting the color alpha.")]
public class ShowSprite : FungusCommand
{
public SpriteRenderer spriteRenderer;
public bool visible = true;
public override void OnEnter()
{
if (spriteRenderer != null)
{
Color spriteColor = spriteRenderer.color;
spriteColor.a = visible ? 1f : 0f;
spriteRenderer.color = spriteColor;
}
Continue();
}
public override string GetSummary()
{
if (spriteRenderer == null)
{
return "Error: No sprite renderer selected";
}
return spriteRenderer.name + " to " + (visible ? "visible" : "invisible");
}
public override Color GetButtonColor()
{
return new Color32(221, 184, 169, 255);
}
}
}

8
Assets/Fungus/Sprite/Commands/ShowSprite.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 10cd462c89cb047158ccfb8a8df3f60a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save