void Awake()
    {
        SlotIndex = (int)(transform.name[4]) - 48;
        Name      = transform.Find("NameText").GetComponent <Text>();
        LvlClass  = transform.Find("LvlClassText").GetComponent <Text>();

        PlayButtonObject   = transform.Find("PlayButton").gameObject;
        DeleteButtonObject = transform.Find("DeleteButton").gameObject;
        CreateButtonObject = transform.Find("CreateButton").gameObject;
        if (SaveLoadManager.Instance)
        {
            SLM = SaveLoadManager.Instance;
        }
        else
        {
            SLM = FindObjectOfType <SaveLoadManager>();
        }
        PlayerData = SLM.LoadPlayerInfo(SlotIndex);
    }
Exemple #2
0
    protected override void Awake()
    {
        base.Awake();

        //QualitySettings.vSyncCount = 0;
        //Application.targetFrameRate = 30;

        if (FirstWeapon != null)
        {
            FirstWeapon.GetComponent <EquipmentController>().InstantiateLoot(transform);
        }
        EquipPrefabs = new Dictionary <string, GameObject>();

        if (transform.parent.name == "MainPlayer")
        {
            if (ControllerManager.Instance)
            {
                CM = ControllerManager.Instance;
            }
            else
            {
                CM = FindObjectOfType <ControllerManager>();
            }
            if (SaveLoadManager.Instance)
            {
                SLM = SaveLoadManager.Instance;
            }
            else
            {
                SLM = FindObjectOfType <SaveLoadManager>();
            }
            PUIC       = transform.parent.Find("PlayerUI").GetComponent <PlayerUIController>();
            PlayerData = SLM.LoadPlayerInfo(SLM.SlotIndexToLoad);
        }
        IC       = transform.Find("Indication Board").GetComponent <IndicationController>();
        Actives  = transform.Find("Actives");
        Passives = transform.Find("Passives");
        InitPlayer();
    }
Exemple #3
0
 public static void SaveCharacter(CharacterDataStruct PlayerData)
 {
     CharacterData[PlayerData.SlotIndex] = PlayerData;
 }