示例#1
0
 // param1 = in or out
 // param2 = text, delimited by underscores
 public override void Func(string[] _params)
 {
     if (_params[0].Equals("out"))
     {
         if (WrittenNoteInstance == null)
         {
             UnityWrapper.LogWarningFormat("WrittenNoteInstance is null; trying to fade out when there isn't a note?");
         }
         else
         {
             WrittenNoteInstance.GetComponent <WrittenNoteObjectScript>().HideNote();
             WrittenNoteInstance = null;
         }
     }
     else
     {
         string param2_fixed = _params[1].Replace('_', ' ');
         param2_fixed        = param2_fixed.Replace("\\n", "\n");
         WrittenNoteInstance = GameObject.Instantiate <GameObject>(WrittenNotePrefab, ScriptMaster.GetCanvas(M22.ScriptMaster.CANVAS_TYPES.POSTCHARACTER).transform);
         WrittenNoteInstance.GetComponentInChildren <Text>().text = param2_fixed;
     }
 }
示例#2
0
 public override void Func(string[] _params)
 {
     if (_params[0].Equals("out"))
     {
         if (SpriteInstance == null)
         {
             UnityWrapper.LogWarningFormat("DrawSprite is null; trying to fade out when there isn't a sprite?");
         }
         else
         {
             SpriteInstance.GetComponent <SpriteObjectScript>().Hide();
             SpriteInstance = null;
         }
     }
     else
     {
         SpriteInstance = GameObject.Instantiate <GameObject>(SpritePrefab, ScriptMaster.GetCanvas(M22.ScriptMaster.CANVAS_TYPES.POSTCHARACTER).transform);
         SpriteInstance.GetComponent <SpriteObjectScript>().SetSprite(Resources.Load <Sprite>("Images/" + _params[1]));
     }
 }