示例#1
0
 /// <summary>
 /// Create a new Notifier with information receive.
 /// </summary>
 /// <param name="ps"></param>
 public void DoNotifier(string title,string text,PlaceScreen ps,int clip,GameObject target,string method)
 {
     m_Title.text = title;
     m_Text.text = text;
     StartCoroutine(TypeText());
     switch (ps)
     {
         case PlaceScreen.Top:
             m_Anim["Top"].speed = 1.0f;
             m_Anim.Play("Top");
             CurrentAnim = "Top";
             break;
         case PlaceScreen.TopLeft:
             m_Anim["TopLeft"].speed = 1.0f;
             m_Anim.Play("TopLeft");
             CurrentAnim = "TopLeft";
             break;
         case PlaceScreen.TopRight:
             m_Anim["TopRight"].speed = 1.0f;
             m_Anim.Play("TopRight");
             CurrentAnim = "TopRight";
             break;
         case PlaceScreen.Middle:
             m_Anim["Middle"].speed = 1.0f;
             m_Anim.Play("Middle");
             CurrentAnim = "Middle";
             break;
         case PlaceScreen.MiddleLeft:
             m_Anim["MiddleLeft"].speed = 1.0f;
             m_Anim.Play("MiddleLeft");
             CurrentAnim = "MiddleLeft";
             break;
         case PlaceScreen.MiddleRight:
             m_Anim["MiddleRight"].speed = 1.0f;
             m_Anim.Play("MiddleRight");
             CurrentAnim = "MiddleRight";
             break;
         case PlaceScreen.Botton:
             m_Anim["Botton"].speed = 1.0f;
             m_Anim.Play("Botton");
             CurrentAnim = "Botton";
             break;
         case PlaceScreen.BottonLeft:
             m_Anim["BottonLeft"].speed = 1.0f;
             m_Anim.Play("BottonLeft");
             CurrentAnim = "BottonLeft";
             break;
         case PlaceScreen.BottonRight:
             m_Anim["BottonRight"].speed = 1.0f;
             m_Anim.Play("BottonRight");
             CurrentAnim = "BottonRight";
             break;
     }
     if (Clips[clip] != null)
     {
         GetComponent<AudioSource>().clip = Clips[clip];
         GetComponent<AudioSource>().Play();
     }
     if (target != null && method != string.Empty)
     {
         target.SendMessage(method, SendMessageOptions.DontRequireReceiver);
     }
 }
 public void NewNotifier(string title, string text, PlaceScreen place, GameObject target, string method)
 {
     NewNotifier(title, text, place, 6f, 0, target, method);
 }
 public void NewNotifier(string title, string text, PlaceScreen place,int clip)
 {
     NewNotifier(title, text, place, 10f, clip,null,"");
 }
    /// <summary>
    /// Create a New Notifier
    /// </summary>
    /// <param name="title"></param>
    /// <param name="text"></param>
    /// <param name="place"></param>
    /// <param name="time"></param>
    public void NewNotifier(string title, string text, PlaceScreen place,float time,int clip,GameObject target,string method)
    {
        GameObject g = new GameObject();
        g.AddComponent<Notifier>();
        g.transform.parent = this.transform;
        Notifier n = g.GetComponent<Notifier>();
        //get and set values for the new notifier
       // n.m_Title = title;

        n.m_Text = text;
        n.m_Time = time;
        n.m_Place = place;
        n.clip = clip;
        n.m_Target = target;
        n.m_Method = method;
        //Add the new notifier to list
        m_Notifiers.Add(n);
    }