Beispiel #1
0
    // Start is called before the first frame update
    private void Awake()
    {
        _instance = this;

        if (SaveData.isHaveData())
        {
            pi = SaveData.data.info;
        }
        else
        {
            pi = new PlayerInfo();
        }

        if (pi.ItemDic.Count == 0)
        {
            pi.ItemDic.Add("drug", 0);
        }
        if (pi.Teach.Count == 0)
        {
            pi.Teach.Add("Equip", false);
        }
        if (pi.SkillDic.Count == 0)
        {
            pi.SkillDic.Add("triplesword", false);
            pi.SkillDic.Add("sitdown", false);
            pi.SkillDic.Add("doublejump", false);
            pi.SkillDic.Add("dash", false);
            pi.SkillDic.Add("walljump", false);
        }
    }
Beispiel #2
0
 private void Awake()
 {
     //  _healthindex = HealthImage.Length;
     pic           = GetComponent <PlayerInfoController>();
     _anim         = GetComponentInChildren <Animator>();
     _rigi         = GetComponentInChildren <Rigidbody2D>();
     ResetPoint    = transform.position;
     _gravityscale = _rigi.gravityScale;
 }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            mbLoaded = false;
        }
        else
        {
            Destroy(gameObject);
        }

        LoadJsonData(out mInfos, AnimHash.PLAYER_DATA_PATH);
    }
Beispiel #5
0
    //public int[] LevelArr {
    //    get {
    //        int[] arr = new int[mInfos.Length];
    //        for (int i = 0; i < arr.Length; i++)
    //        {
    //            arr[i] = mInfos[i].Level;
    //        }
    //        return arr;
    //    }
    //}

    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            mbLoaded = false;
        }
        else
        {
            Destroy(gameObject);
        }
        Debug.Log("sdfsdfs");
        LoadJsonData(out mInfos, StaticValues.PLAYER_DATA_PATH);
    }
    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
        if (playerInfoController == null)
        {
            try
            {
                LoadGame();
            }
            catch
            {
                SetDefaultValue();
            }

            playerInfoController = this;
        }
        else if (playerInfoController != this)
        {
            Destroy(gameObject);
        }
    }
 void Awake()
 {
     Instance = this;
 }
 public PlayerInfoControllerTest()
 {
     _seed       = Guid.NewGuid().ToString();
     _controller = MockController.CreateController <PlayerInfoController>(_seed, "user");
 }