Beispiel #1
0
    public void clear()
    {
        text = "";

        gameAnimation.stopAnimation();
        gameAnimation.clearAnimation();
    }
Beispiel #2
0
    public void showEffect(int s1, int s2, int s3)
    {
        for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++)
        {
            if (activeBattleStage.Layer.L1[j].ParmEffect == s1)
            {
                if (objsLayer1[j] == null)
                {
                    continue;
                }

                GameAnimation animation = objsLayer1[j].GetComponent <GameAnimation>();

                if (s2 == 0)
                {
                    animation.stopAnimation();
                    animation.clearAnimation();
                }
                else
                {
                    if (activeBattleStage.Layer.L1[j].Pause == 0)
                    {
                        animation.playAnimation();
                    }
                    else
                    {
                        animation.stopAnimation();
                        animation.showFrame(0);
                    }
                }
            }
        }
    }
Beispiel #3
0
    void clear()
    {
        text.text       = "";
        okText.text     = "";
        cancelText.text = "";

        okGameAnimation.stopAnimation();
        okGameAnimation.clearAnimation();

        cancelGameAnimation.stopAnimation();
        cancelGameAnimation.clearAnimation();
    }
Beispiel #4
0
    public void unShow()
    {
        isShow = false;

        gameAnimation.stopAnimation();
        gameAnimation.clearAnimation();
    }
Beispiel #5
0
    public void updateUpDonw()
    {
        upAnimation.stopAnimation();
        upAnimation.clearAnimation();

        downAnimation.stopAnimation();
        downAnimation.clearAnimation();

        if (selectionPos > 0)
        {
            if (!enabled1)
            {
                upAnimation.showFrame(18);
            }
            else
            {
                upAnimation.playAnimation(18, 22);
            }
        }

        if (selectionPos < itemCount - MAX_SLOT)
        {
            if (!enabled1)
            {
                downAnimation.showFrame(22);
            }
            else
            {
                downAnimation.playAnimation(22, 26);
            }
        }
    }
Beispiel #6
0
    public void unShowEffect(int id, int s)
    {
        for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++)
        {
            if (activeBattleStage.Layer.L1[j].Parm == id)
            {
                if (objsLayer1[j] == null)
                {
                    continue;
                }

                GameAnimation animation = objsLayer1[j].GetComponent <GameAnimation>();

                animation.stopAnimation();
                animation.clearAnimation();
            }

//             if ( activeBattleStage.Layer.L1[ j ].ParmEffect != GameDefine.INVALID_ID )
//             {
//                 if ( GameUserData.instance.getGameData( activeBattleStage.Layer.L1[ j ].ParmEffect ) != 1 )
//                 {
//                     GameAnimation animation = objsLayer1[ j ].GetComponent<GameAnimation>();
//                     animation.stopAnimation();
//                     animation.clearAnimation();
//                 }
//             }
        }
    }
Beispiel #7
0
 void onLevelShowOver()
 {
     levelUpAnimation.stopAnimation();
     levelUpAnimation.clearAnimation();
     Destroy(levelUpAnimation.gameObject);
     levelUpAnimation.transform.SetParent(null);
     levelUpAnimation = null;
 }
Beispiel #8
0
 void onAddShowOver()
 {
     addAnimation.stopAnimation();
     addAnimation.clearAnimation();
     Destroy(addAnimation.gameObject);
     addAnimation.transform.SetParent(null);
     addAnimation = null;
 }
Beispiel #9
0
    public void unShow()
    {
        isShow = false;

        gameObject.SetActive(false);

        gameAnimation.stopAnimation();
        gameAnimation.clearAnimation();
    }
Beispiel #10
0
    public void clearAnimation(int id)
    {
        if (!animations.ContainsKey(id))
        {
            return;
        }

        GameAnimation animation = animations[id];

        animation.stopAnimation();
        animation.clearAnimation();
    }
Beispiel #11
0
    public void unShow()
    {
        GameBattleUserLeftUI.instance.unShowFade();
        GameBattleUserRightUI.instance.unShowFade();

        isShow = false;

        gameAnimation.stopAnimation();
        gameAnimation.clearAnimation();

        gameObject.SetActive(false);
    }
Beispiel #12
0
    void startAnimation()
    {
        gameAnimation.stopAnimation();

        if (playStartAnimation)
        {
            if (moveToX != posX)
            {
                if (moveToX > posX)
                {
                    gameAnimation.playAnimationBattle(GameAnimationType.MoveStart,
                                                      GameAnimationDirection.East, onStartMove);
                }
                else
                {
                    gameAnimation.playAnimationBattle(GameAnimationType.MoveStart,
                                                      GameAnimationDirection.West, onStartMove);
                }
            }
            else
            {
                if (moveToY > posY)
                {
                    gameAnimation.playAnimationBattle(GameAnimationType.MoveStart,
                                                      GameAnimationDirection.South, onStartMove);
                }
                else
                {
                    gameAnimation.playAnimationBattle(GameAnimationType.MoveStart,
                                                      GameAnimationDirection.North, onStartMove);
                }
            }
        }
        else
        {
            isMoving = true;
        }
    }
Beispiel #13
0
    public void clearAnimation(int id, int id2)
    {
        string str = id + " " + id2;

        if (!animations.ContainsKey(str))
        {
            return;
        }

        GameAnimation animation = animations[str];

        animation.stopAnimation();
        animation.clearAnimation();
    }
Beispiel #14
0
    public void clear()
    {
        text.clear();

        if (gameAnimation != null)
        {
            gameAnimation.stopAnimation();
            gameAnimation.clearAnimation();

            Destroy(gameAnimation.gameObject);
            gameAnimation.transform.SetParent(null);

            gameAnimation = null;
        }
    }
Beispiel #15
0
    public void showLevelUp(OnEventOver over)
    {
        if (!isShow)
        {
            over();
            return;
        }

        if (side == GameBattleAttackResultSide.Left)
        {
            if (rangedAttack)
            {
                rightAnimation.stopAnimation();
                rightAnimation.clearAnimation();
            }
        }
        else
        {
            if (rangedAttack)
            {
                leftAnimation.stopAnimation();
                leftAnimation.clearAnimation();
            }
        }

        string path = "Prefab/Misc/Ftlup_r";

        GameObject obj   = Instantiate <GameObject>(Resources.Load <GameObject>(path));
        Transform  trans = obj.transform;

        trans.SetParent(right.transform);
        trans.localScale    = Vector3.one;
        trans.localPosition = Vector3.zero;

        levelUpAnimation    = obj.GetComponent <GameAnimation>();
        levelUpAnimation.UI = true;
        levelUpAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onLevelShowOver);

        rightAnimation.playAnimation(6, 6 + rightAnimation.safHead.count3[0], false, over);
    }
Beispiel #16
0
    public void playAnimation(int id, int id2, int frame, int endFrame, OnEventOver over)
    {
        string str = id + " " + id2;

        if (!animations.ContainsKey(str))
        {
            return;
        }

#if UNITY_EDITOR
        Debug.Log("playAnimation " + animations[str].gameObject.name);
#endif

        GameAnimation animation = animations[str];

        Transform trans = animation.transform;
        trans.localPosition = new Vector3(GameRPGSceneMovement.instance.PosXReal,
                                          GameRPGSceneMovement.instance.PosYReal + layerHeight,
                                          -id2 * 20);

        if (frame == GameDefine.INVALID_ID)
        {
            animation.playAnimation(0, GameDefine.INVALID_ID, false, over);
        }
        else
        {
            if (frame == endFrame)
            {
                animation.stopAnimation();
                animation.showFrame(endFrame);

                if (over != null)
                {
                    over();
                }
            }
            else
            {
                animation.playAnimation(frame, endFrame + 1, false, over);
            }

            //                animation.stopAnimation();
            //               animation.showFrame( frame );
        }
    }
Beispiel #17
0
    public void showUser(bool b)
    {
        isShowUser = b;

        if (b)
        {
            left.stopAnimation();
            left.clearAnimation();

            right.stopAnimation();
            right.clearAnimation();

            select(0);
        }
        else
        {
            clearSelection();

            left.playAnimation(14, 18);
            right.playAnimation(18, 22);
        }
    }
Beispiel #18
0
    public void addAnimation(int id, int id2)
    {
        GameAnimation ani = null;

        string str = id + " " + id2;

        if (animations.ContainsKey(str))
        {
            ani = animations[str];
            ani.stopAnimation();
            ani.clearAnimation();
            Destroy(ani.gameObject);
            ani.transform.SetParent(null);
            animations.Remove(str);
        }

        for (int i = 0; i < activeRPGStage.Layer.L1.Length; i++)
        {
            if (activeRPGStage.Layer.L1[i].ID == id &&
                activeRPGStage.Layer.L1[i].Parm == id2)
            {
                string path = "Prefab/RPG/RPG" + GameDefine.getString2(activeID) + "/";
                path += activeRPGStage.Layer.L1[i].Name;

                GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path));
                ani = obj.GetComponent <GameAnimation>();

                Transform trans = obj.transform;
                trans.SetParent(transEvent);
                trans.localPosition = new Vector3(0.0f, layerHeight, 0.0f);
                trans.localScale    = new Vector3(1.0f, 1.0f, 1.0f);

                animations.Add(str, ani);

                return;
            }
        }
    }
Beispiel #19
0
    public void addAnimation(int id, int name)
    {
        GameAnimation ani = null;

        if (animations.ContainsKey(id))
        {
            ani = animations[id];
            ani.stopAnimation();
            ani.clearAnimation();
            ani.transform.SetParent(null);
            Destroy(ani.gameObject);
            animations.Remove(id);
        }

        //        else
        //        {
        string path = "Prefab/Stage/Stage" + GameDefine.getString2(GameUserData.instance.Stage) + "/Eanm_";

        path += GameDefine.getString2(name);

        GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>(path));

        ani      = obj.GetComponent <GameAnimation>();
        obj.name = "Eanm_" + GameDefine.getString2(name);

        Transform trans = obj.transform;

        trans.SetParent(transBackground);
        trans.localPosition = new Vector3(0.0f, layerHeight, 0.0f);
        trans.localScale    = new Vector3(1.0f, 1.0f, 1.0f);

        ani.lastUnitID = LastUnitID;
        LastUnitID     = GameDefine.INVALID_ID;

        animations.Add(id, ani);

        //        }
    }
Beispiel #20
0
 public override void onUnShow()
 {
     gameAnimation.stopAnimation();
     gameAnimation.clearAnimation();
 }
Beispiel #21
0
 public void clearGameAnimation()
 {
     gameAnimation.stopAnimation();
     gameAnimation.clearAnimation();
 }
Beispiel #22
0
    private void onAnimationEvent(int i)
    {
        if (mapAttack)
        {
            return;
        }

        GameAnimation.SAF1 saf1 = attackerAnimation.saf1[i];

        bool hideDefencer = (attackerAnimation.safHead.count3[1] > 0 &&
                             i >= attackerAnimation.safHead.count3[1] &&
                             i < attackerAnimation.safHead.count3[2]);

        if (hideDefencer && defencerAnimation.start)
        {
            defencerAnimation.stopAnimation();
            defencerAnimation.clearAnimation();
        }

        if (saf1.hit > 0)
        {
            if (!showAdd && result.AddType != GameAttackAddType.None)
            {
                showAdd = true;

                switch (result.AddType)
                {
                case GameAttackAddType.AbsorbHP:
                    break;

                case GameAttackAddType.Poison:
                {
                    string path = "Prefab/Misc/Sp003" + (side == GameBattleAttackResultSide.Left ? "l" : "r");

                    GameObject obj = Instantiate(Resources.Load <GameObject>(path));
                    addAnimation    = obj.GetComponent <GameAnimation>();
                    addAnimation.UI = true;

                    obj.transform.SetParent(attackerAnimation.transform.parent);
                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver);
                }
                break;

                case GameAttackAddType.Palsy:
                {
                    string path = "Prefab/Misc/Sp005" + (side == GameBattleAttackResultSide.Left ? "l" : "r");

                    GameObject obj = Instantiate(Resources.Load <GameObject>(path));
                    addAnimation    = obj.GetComponent <GameAnimation>();
                    addAnimation.UI = true;

                    obj.transform.SetParent(attackerAnimation.transform.parent);
                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver);
                }
                break;

                case GameAttackAddType.Silence:
                {
                    string path = "Prefab/Misc/Sp002" + (side == GameBattleAttackResultSide.Left ? "l" : "r");

                    GameObject obj = Instantiate(Resources.Load <GameObject>(path));
                    addAnimation    = obj.GetComponent <GameAnimation>();
                    addAnimation.UI = true;

                    obj.transform.SetParent(attackerAnimation.transform.parent);
                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    addAnimation.playAnimation(0, GameDefine.INVALID_ID, false, onAddShowOver);
                }
                break;

                case GameAttackAddType.Fetter:
                    break;

                case GameAttackAddType.Clear:
                    break;
                }
            }

            if (result.type == GameBattleAttackResultPhysical.Type.Block)
            {
                if (defencerAnimation.startFrame != 0 &&
                    !hideDefencer)
                {
                    defencerAnimation.playAnimation(0, 1);
                }
            }
            else
            {
                if (result.type == GameBattleAttackResultPhysical.Type.Critical)
                {
                    white.SetActive(true);
                    startWhite = true;
                    timeWhite  = 0.0f;
                }

                if (defencerAnimation.startFrame != 1 &&
                    !hideDefencer)
                {
                    defencerAnimation.playAnimation(1, 3);
                }
            }

            if (side == GameBattleAttackResultSide.Left)
            {
                rightInfoUI.setValue(hitHP[hitCount]);
            }
            else
            {
                leftInfoUI.setValue(hitHP[hitCount]);
            }

            hitCount++;
        }
        else
        {
            if (rangedAttack && attackerAnimation.safHead.count3[0] > i)
            {
                return;
            }

            int f = 6 + (defencerAnimation.safHead.count3[0] == 0 ? 1 : defencerAnimation.safHead.count3[0]);

            if (defencerAnimation.startFrame != f &&
                !hideDefencer)
            {
                defencerAnimation.playAnimation(f, f + defencerAnimation.safHead.count3[1]);
            }
        }
    }
Beispiel #23
0
    void onAttackOver2()
    {
        GameBattleJumpHPUI.instance.jump(side, jumpHP, onJumpHPOver2);

        attackerAnimation.stopAnimation();
        attackerAnimation.clearAnimation();

        if (side == GameBattleAttackResultSide.Left)
        {
            int f = 6 + (leftAnimation.safHead.count3[0] == 0 ? 1 : leftAnimation.safHead.count3[0]);

            if (!rangedAttack)
            {
                leftAnimation.playAnimation(f, f + leftAnimation.safHead.count3[1]);
            }

            f = 6 + (rightAnimation.safHead.count3[0] == 0 ? 1 : rightAnimation.safHead.count3[0]);
            rightAnimation.playAnimation(f, f + rightAnimation.safHead.count3[1]);
        }
        else
        {
            int f = 6 + (rightAnimation.safHead.count3[0] == 0 ? 1 : rightAnimation.safHead.count3[0]);

            if (!rangedAttack)
            {
                rightAnimation.playAnimation(f, f + rightAnimation.safHead.count3[1]);
            }

            f = 6 + (leftAnimation.safHead.count3[0] == 0 ? 1 : leftAnimation.safHead.count3[0]);
            leftAnimation.playAnimation(f, f + leftAnimation.safHead.count3[1]);
        }

        int HP = 0;

        if (side == GameBattleAttackResultSide.Left)
        {
            HP = rightUnit.HP;
        }
        else
        {
            HP = leftUnit.HP;
        }

        kill = (HP <= result.HP + result.HP2);

        hitHP.Clear();

        jumpHP = result.HP2;

        hitCount = 0;
        for (int i = 0; i < attackerAnimation.saf1.Length; i++)
        {
            if (attackerAnimation.saf1[i].hit > 0)
            {
                hitCount++;
            }
        }

        int[] hit = new int[hitCount];

        hitCount = 0;
        for (int i = 0; i < attackerAnimation.saf1.Length; i++)
        {
            if (attackerAnimation.saf1[i].hit > 0)
            {
                hit[hitCount] = i;
                hitCount++;
            }
        }

        int hitAll = 0;

        for (int i = 0; i < hitCount; i++)
        {
            hitAll += hit[i];
        }

        float per = 0.0f;

        for (int i = 0; i < hitCount; i++)
        {
            per += hit[i] / (float)hitAll;

            if (i == hitCount - 1)
            {
                hitHP.Add(HP - result.HP - jumpHP);
            }
            else
            {
                hitHP.Add(HP - result.HP - (int)(per * jumpHP));
            }
        }

        hitCount = 0;
    }
Beispiel #24
0
 public void stopAnimation()
 {
     gameAnimation.stopAnimation();
 }
Beispiel #25
0
    public void playAnimation(int id, int id2, int frame, int endFrame, OnEventOver over)
    {
        if (!animations.ContainsKey(id))
        {
            return;
        }

#if UNITY_EDITOR
        Debug.Log("playAnimation " + animations[id].gameObject.name);
#endif

        onEventOver = over;

        GameAnimation animation = animations[id];

        int height = layerHeight;

        bool bUpdateHeight = false;

        if (id2 >= 10000500 && GameUserData.instance.Stage == 19)
        {
            // fix stage 7 19 bug
            height        = 2 * 5000;
            bUpdateHeight = true;

            GameAnimation ani = objsLayer0[1].GetComponent <GameAnimation>();
            ani.stopAnimation();
            ani.clearAnimation();
        }

        if ((id2 >= 20000000 && GameUserData.instance.Stage == 7) ||
            (id2 >= 20000000 && GameUserData.instance.Stage == 14))
        {
            // fix stage 7 14 bug

            height        = 2 * 5000;
            bUpdateHeight = true;
        }

        float z = GameDefine.getZ(id2);

        if (id2 >= 20000000)
        {
            z -= 3000;
        }

        Transform trans = animation.transform;

        if (animation.lastUnitID != GameDefine.INVALID_ID)
        {
            GameBattleUnit unit = GameBattleUnitManager.instance.getUnit(animation.lastUnitID);

            GameBattleSceneMovement.instance.moveToEvent(unit.PosX - GameCameraManager.instance.xCell,
                                                         unit.PosY - GameCameraManager.instance.yCell);

            trans.localPosition = new Vector3(GameBattleSceneMovement.instance.PosXReal,
                                              GameBattleSceneMovement.instance.PosYReal + height, z);
        }
        else
        {
            trans.localPosition = new Vector3(GameBattleSceneMovement.instance.AnimationPosX,
                                              GameBattleSceneMovement.instance.AnimationPosY + height,
                                              z);
        }


        if (id2 >= 20000000 &&
            GameUserData.instance.Stage == 23)
        {
            // fix stage 23 bug

            trans.localPosition = new Vector3(GameBattleSceneMovement.instance.PosXReal,
                                              GameBattleSceneMovement.instance.PosYReal + height, z);

            trans.localScale = new Vector3(GameCameraManager.instance.sceneWidth / 320.0f, 1.0f, 1.0f);
        }

        if (id2 == 10000500 &&
            GameUserData.instance.Stage == 24)
        {
            // fix stage 24 bug

            trans.localPosition = new Vector3(260.0f,
                                              -620.0f + height, z);
        }

        if (frame == GameDefine.INVALID_ID)
        {
            animation.playAnimation(0, GameDefine.INVALID_ID, false, onEffectPlayOver);
        }
        else
        {
            if (frame == endFrame)
            {
                animation.stopAnimation();
                animation.showFrame(endFrame);

                if (onEventOver != null)
                {
                    onEventOver();
                }
            }
            else
            {
                animation.playAnimation(frame, endFrame + 1, false, onEffectPlayOver);
            }

            //                animation.stopAnimation();
            //               animation.showFrame( frame );
        }

        if (bUpdateHeight)
        {
            GameCameraManager.instance.setPos(GameBattleSceneMovement.instance.PosXReal,
                                              GameBattleSceneMovement.instance.PosYReal + height);
        }
    }
Beispiel #26
0
    public void playOnceEffect(int id, int frame, int endFrame, OnEventOver over)
    {
        onEventOver = over;

        bool b = false;

        for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++)
        {
            if (activeBattleStage.Layer.L1[j].Parm == id)
            {
                if (activeBattleStage.Layer.L1[j].ParmEffect != GameDefine.INVALID_ID)
                {
                    if (GameUserData.instance.getGameData(activeBattleStage.Layer.L1[j].ParmEffect) != 1)
                    {
                        continue;
                    }
                }

                lastEffectID = j;
                GameAnimation animation = objsLayer1[j].GetComponent <GameAnimation>();

#if UNITY_EDITOR
                Debug.Log("playOnceEffect " + animation.gameObject.name + " " + j);
#endif

                if (frame == GameDefine.INVALID_ID)
                {
                    if (activeBattleStage.Layer.L1[j].Pause == 0)
                    {
                        animation.stopAnimation();
                        animation.showFrame(endFrame);
                    }
                    else
                    {
                        if (!b)
                        {
                            animation.playAnimation(0, GameDefine.INVALID_ID, false, onEffectPlayOver1);
                        }
                        else
                        {
                            animation.playAnimation(0, GameDefine.INVALID_ID, false, null);
                        }

                        b = true;
                    }
                }
                else
                {
                    if (frame == endFrame)
                    {
                        animation.stopAnimation();
                        animation.showFrame(endFrame);
                    }
                    else
                    {
                        if (!b)
                        {
                            animation.playAnimation(frame, endFrame + 1, false, onEffectPlayOver1);
                        }
                        else
                        {
                            animation.playAnimation(frame, endFrame + 1, false, null);
                        }

                        b = true;
                    }
                }
            }
        }


        if (!b)
        {
            onEffectPlayOver1();
        }
    }
Beispiel #27
0
    public void showEffect(int id, int s)
    {
        for (int j = 0; j < activeBattleStage.Layer.L1.Length; j++)
        {
            if (activeBattleStage.Layer.L1[j].Parm == id)
            {
                if (objsLayer1[j] == null)
                {
                    string path        = GameDefine.getString2(GameUserData.instance.Stage);
                    string pathDir     = "Prefab/Stage/Stage" + path + "/";
                    string pathTexture = pathDir + activeBattleStage.Layer.L1[j].Name;

                    GameObject imgObject = Resources.Load <GameObject>(pathTexture);
                    GameObject obj       = Instantiate(imgObject, transBackground);
                    obj.name = activeBattleStage.Layer.L1[j].Name;

                    Transform trans = obj.transform;
                    trans.localPosition = new Vector3(GameBattleSceneMovement.instance.AnimationPosX,
                                                      GameBattleSceneMovement.instance.AnimationPosY + layerHeight, 1.0f);

                    trans.localScale = new Vector3(1.0f, 1.0f, 1.0f);

                    GameAnimation animation = obj.GetComponent <GameAnimation>();

                    objsLayer1[j] = animation.gameObject;

                    if (GameUserData.instance.Stage == 29)
                    {
                        // fix stage 29 bug

                        trans.localPosition = new Vector3(GameBattleSceneMovement.instance.AnimationPosX,
                                                          GameBattleSceneMovement.instance.AnimationPosY + layerHeight, -1005.0f);
                    }

                    if (GameUserData.instance.Stage == 34 && id == 6)
                    {
                        // fix stage 34 bug

                        trans.localPosition = new Vector3(0.0f, layerHeight, 1.0f);
                    }

                    if (activeBattleStage.Layer.L1[j].Pause == 0)
                    {
                        animation.playAnimation();
                    }
                    else
                    {
                        animation.stopAnimation();
                        animation.showFrame(0);
                    }

                    return;
                }

                GameAnimation animation1 = objsLayer1[j].GetComponent <GameAnimation>();

                if (activeBattleStage.Layer.L1[j].Pause == 0)
                {
                    animation1.playAnimation();
                }
                else
                {
                    animation1.stopAnimation();
                    animation1.showFrame(0);
                }
            }
        }
    }