Example #1
0
    public void initPos(int i)
    {
        GameRPGPosInfo info = activeInfo.Pos[i];

//        GameRPGSceneMovement.instance.moveTo( info.MapPosX , info.MapPosY );

        GameMusicManager.instance.playMusic(0, "Music/Music_" + GameDefine.getString2(info.Music));

        string path = "Prefab/RPG/Rpgman";

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

        gameAnimation = obj.GetComponent <GameAnimation>();
        obj.name      = "Rpgman";

        gameAnimation.playAnimationRPG(GameAnimationType.Stand, GameAnimationDirection.South, null);

        Transform trans = obj.transform;

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

        movement = obj.AddComponent <GameRPGMovement>();
        movement.setPos(info.PosX, info.PosY);
        movement.setDirection((GameAnimationDirection)info.Direction);

        GameRPGSceneMovement.instance.followPos(movement.PosBattleX, movement.PosBattleY);
    }
Example #2
0
    public void clear()
    {
        visibleLayer(true);

        clearStage();

        activeID       = GameDefine.INVALID_ID;
        activeDTL      = null;
        activeRPGStage = null;
        activeInfo     = null;

        objsLayer1 = null;
        objsLayer0 = null;

        movement      = null;
        gameAnimation = null;

        animations.Clear();
    }