Beispiel #1
0
    public void Initialize()
    {
        this.enabled = true;
        if (animator == null)
        {
            Debug.LogWarning(string.Format("GameObject:{0} cannot find animator component.", this.transform.name));
            this.enabled = false;
            return;
        }

        if (animatorController == null)
        {
            Debug.LogWarning("Please assign animator in editor. Add emitter at runtime is not currently supported.");
            this.enabled = false;
            return;
        }

        if (data == null)
        {
            this.enabled = false;
            return;
        }

        mecanimEventHandler = GetComponent <IMecanimEventHandler> ();
        if (mecanimEventHandler == null)
        {
            Debug.LogWarning("Please make sure you have a IMecanimEventHandler component");
            this.enabled = false;
            return;
        }
        SetData(data);
    }
Beispiel #2
0
    void Awake()
    {
        if (animator == null)
        {
            Debug.LogWarning("Do not find animator component.");
            this.enabled = false;
            return;
        }

        if (animatorController == null)
        {
            Debug.LogWarning("Please assign animator in editor. Add emitter at runtime is not currently supported.");
            this.enabled = false;
            return;
        }

        mecanimEventHandler = GetComponent <IMecanimEventHandler> ();
        if (mecanimEventHandler == null)
        {
            Debug.LogWarning("Please make sure you have a IMecanimEventHandler component");
            this.enabled = false;
            return;
        }
    }