Exemplo n.º 1
0
    public static EaListener AddListener(GameObject obj, float listenFrequency, Action OnListenComplete, Detail detail = default(Detail))
    {
        EaListener listener = obj.AddComponent <EaListener> ();

        listener.OnListenComplete = (OnListenComplete);
        listener.listenFrequency  = listenFrequency;
        listener.detail           = detail == default(Detail) ?  new Detail(obj.name, OnListenComplete.Method.Name) : detail;
        return(listener);
    }
Exemplo n.º 2
0
    public static EaListener AddListener <T>(GameObject obj, float listenFrequency, Action OnListenComplete)
    {
        EaListener listener = obj.AddComponent <EaListener> ();

        listener.OnListenComplete = (OnListenComplete);
        listener.listenFrequency  = listenFrequency;
        listener.detail           = new Detail(typeof(T).Name, OnListenComplete.Method.Name);
        return(listener);
    }
Exemplo n.º 3
0
    public static EaListener AddOptions(EaListener listener, Option [] options)
    {
        int optionLength = options.Length;

        for (int i = 0; i < optionLength; i++)
        {
            switch (options [i])
            {
            case Option.IgnoreTimeScale:
                listener.ignoreTimeScale = true;
                break;

            case Option.SelfDestruction:
                listener.selfDestruction = true;
                break;

            case Option.SelfDisable:
                listener.selfDisable = true;
                break;
            }
        }
        return(listener);
    }
Exemplo n.º 4
0
 void Start()
 {
     rendering.sprite = sprites [index];
     EaListener.AddListener <EaAnimation> (gameObject, 1 / (float)frameRate, OnCompletePlaying);
 }
Exemplo n.º 5
0
    public static EaListener AddListener(GameObject obj, float listenFrequency, Action OnListenComplete, params Option [] options)
    {
        EaListener listener = EaListener.AddListener(obj, listenFrequency, OnListenComplete, default(Detail));

        return(AddOptions(listener, options));
    }
Exemplo n.º 6
0
    public static EaListener AddListener <T>(GameObject obj, float listenFrequency, Action OnListenComplete, params Option [] options)
    {
        EaListener listener = AddListener <T> (obj, listenFrequency, OnListenComplete);

        return(AddOptions(listener, options));
    }