コード例 #1
0
    public void InitSaveData()
    {
        if (miscData == null)
        {
            miscData = new MiscData();
        }

        if (playerRuntimeData == null)
        {
            playerRuntimeData = new PlayerRuntimeData();
        }

        miscData.Init();
        playerRuntimeData.InitPlayerRuntimeData(playerData);
    }
コード例 #2
0
    void Awake()
    {
        stateMachine       = new PlayerStateMachine();
        stateCooldownTimer = new PlayerStateCooldownTimer();

        stateMachine.SetStateCooldownTimer(stateCooldownTimer);

        damageImmuneTimer = Time.time;

        Anim = GetComponent <Animator>();
        Rb   = GetComponent <Rigidbody2D>();
        Bc   = GetComponent <BoxCollider2D>();
        Sr   = GetComponent <SpriteRenderer>();
        GM   = GameObject.Find("GameManager")?.GetComponent <GameManager>();

        Anim.runtimeAnimatorController = ACNormal;

        InputHandler = GetComponent <PlayerInputHandler>();

        playerRuntimeData.InitPlayerRuntimeData(playerData);
    }