Esempio n. 1
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        if (battleVFX != null)
        {
            battleVFX.SetAnimeEventCallback((string value) => {
                Debug.Log("AnimeEvent: received. value=" + value);

                if (gameCharacter != null)
                {
                    gameCharacter.ChangeAnimeAction(GameCharacter.AnimeAction.Hit);
                }
            });

            battleVFX.SetAnimeEndCallback(() => {
                Debug.Log("AnimeEvent: Animation End");
            });
        }
    }
    public void Init(BattleVFX _vfxObj, string vfxName)
    {
        mIsDone = false;
        Debug.Log("BattleVFXAction: Init called");
        mVFXObject = _vfxObj;
        mVFXName   = vfxName;


        mVFXObject.SetAnimeEventCallback((string eventName) => {
            Debug.Log("BattleVFXAction: animeEvent. name=" + eventName);
            if (eventName == "hit")
            {
                HitTarget();
            }
        });

        mVFXObject.SetAnimeEndCallback(() => {
            MarkAsDone();
        });
    }