Ejemplo n.º 1
0
 void Awake()
 {
     Counts       = SaveSystem.GetInstance().generalCounts;
     Counts.Index = 0;
     SaveSystem.GetInstance().SaveState();
     LoadScene();
 }
Ejemplo n.º 2
0
    void Start()
    {
        Counts     = SaveSystem.GetInstance().generalCounts;
        player_mov = PlayerPosition.GetComponent <MovimentPlayer>();

        DF = GetComponent <DisplayFrase>();

        fullhealth = health;

        agent = GetComponent <NavMeshAgent>();

        skills = new List <Skills>();

        hoScript = GetComponent <HeartOrbit>();
        Orbit    = new Skills(hoScript.getProb(), hoScript.getCD(), true, hoScript.Expansion);
        skills.Add(Orbit);

        hlScript = GetComponent <HeartLaunch>();
        Launch   = new Skills(hlScript.getProb(), hlScript.getCD(), false, hlScript.Launch);
        skills.Add(Launch);

        hcScript = GetComponent <HeartClap>();
        Clap     = new Skills(hcScript.getProb(), hcScript.getCD(), false, hcScript.Clap);
        skills.Add(Clap);

        SkillCD = GetComponent <BossSkillsCD>();

        anim = GetComponentInChildren <Animator>();
        _rb  = GetComponent <Rigidbody>();

        StartCoroutine(StartBattle());
    }
    // Start is called before the first frame update
    void Start()
    {
        df = GetComponent <DisplayFrase>();

        headAnimator = GetComponentInChildren <Animator>();

        counts = SaveSystem.GetInstance().generalCounts;

        skills = new List <Skills>();

        skillsCD = GetComponent <BossSkillsCD>();

        exmScript = GetComponent <ExMissile>();
        Missile   = new Skills(exmScript.getProb(), exmScript.getCD(), false, exmScript.Shoot);
        skills.Add(Missile);

        expScript = GetComponent <ExPillar>();
        Pillar    = new Skills(expScript.getProb(), expScript.getCD(), false, expScript.InkPillar);
        skills.Add(Pillar);

        StartCoroutine(ResetCooldown());


        HitTentacle.tentacleHit += TakeDamage; //registra a funcao TakeDamage ao evento tentacleHit
    }
Ejemplo n.º 4
0
    void Start()
    {
        DF = GetComponent <DisplayFrase>();

        Counts = SaveSystem.GetInstance().generalCounts;

        Agent = GetComponent <NavMeshAgent>();

        Path = new NavMeshPath();

        skills = new List <Skills>();

        srScript = GetComponent <SadRain>();

        spScript = GetComponent <SadPistol>();
        Pistol   = new Skills(spScript.getProb(), spScript.getCD(), false, spScript.Pistol);
        skills.Add(Pistol);

        srlScript = GetComponent <SadRoll>();
        Roll      = new Skills(srlScript.getProb(), srlScript.getCD(), false, srlScript.Roll);
        skills.Add(Roll);

        SkillCD = GetComponent <BossSkillsCD>();
        anim    = GetComponentInChildren <Animator>();

        StartCoroutine(StartBattle());
    }
Ejemplo n.º 5
0
 void Start()
 {
     Counts           = SaveSystem.GetInstance().generalCounts;
     NormalDialogue   = GetComponent <DisplayFrase>();
     CoordenadaPlayer = 0;
     NumberOfChoices  = 0;
     ControlAcess     = true;
 }
Ejemplo n.º 6
0
    public void NewGame()
    {
        generalCounts = GameObject.Instantiate(emptySave);
        SaveState();
        SucessfulLoad = true;
        string path = Path.Combine(Application.persistentDataPath, saveFileName + ".dat");

        Debug.Log("new save on path:" + path);
    }
Ejemplo n.º 7
0
    public void Start()
    {
        //encontra e define carinhoArea, emissor de partículas que demonstra raio dos corações
        ps          = hearts.GetComponentInChildren <ParticleSystem>();
        carinhoArea = ps.shape;

        Counts = SaveSystem.GetInstance().generalCounts;
        StartCoroutine(DestroyParticles());
    }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     Footsteps    = GetComponent <AudioSource>();
     pegadas      = Footsteps.clip;
     _rb          = GetComponent <Rigidbody>();
     anim         = GetComponentInChildren <Animator>();
     Counts       = SaveSystem.GetInstance().generalCounts;
     CurrentScene = SceneManager.GetActiveScene().name;
 }
Ejemplo n.º 9
0
    public bool LoadState()
    {
        string path        = SavePath;
        string versionPath = VersionSavePath;

        if (!File.Exists(path) || !File.Exists(versionPath))
        {
            return(false);
        }
        using (StreamReader streamReader = File.OpenText(versionPath)) {
            string str = streamReader.ReadToEnd();
            try {
                float ver = float.Parse(str);
                if (ver < saveVersion)
                {
                    Debug.LogWarning("Warning: old save version");
                    return(ValidateOldSave());
                }
            }
            catch (Exception e) {
                Debug.LogWarning("Warning: invalid save-version format" + e.Message);
                return(ValidateOldSave());
            }
        }

        try {
            byte[] buffer = File.ReadAllBytes(path);
            for (int i = 0; i < buffer.Length; i++)
            {
                buffer[i] = (Byte)((~buffer[i]) & 0xFF);
            }
            string jsonString = Encoding.UTF8.GetString(buffer);
            generalCounts = ScriptableObject.CreateInstance <GeneralCounts>();
            JsonUtility.FromJsonOverwrite(jsonString, generalCounts);

            for (int i = 0; i < generalCounts.EventsStrings.Count; i++)
            {
                generalCounts.Events.Add(generalCounts.EventsStrings[i], generalCounts.EventsBools[i]);
            }

            for (int i = 0; i < generalCounts.StatsStrings.Count; i++)
            {
                generalCounts.Stats.Add(generalCounts.StatsStrings[i], generalCounts.StatsInts[i]);
            }

            SucessfulLoad = true;
            return(true);
        }
        catch (Exception e) {
            Debug.LogWarning("Unable to load savefile " + e.Message);
            return(false);
        }
    }
Ejemplo n.º 10
0
 void Start()
 {
     Counts = SaveSystem.GetInstance().generalCounts;
     Canvas.SetActive(false);
     DeathScreen.SetActive(false);
     PauseMenuUI.SetActive(false);
     GameConfigUI.SetActive(false);
     CurrentScene    = SceneManager.GetActiveScene().name;
     player_particle = player.transform.GetChild(0).Find("DeathParticle").GetComponent <ParticleSystem>();
     player_particle.Stop();
     player_particle.Clear();
 }
Ejemplo n.º 11
0
 void Start()
 {
     statsObject.transform.parent.gameObject.SetActive(false);
     Counts = SaveSystem.GetInstance().generalCounts;
     stats  = new StatsObject[5];
     for (int i = 0; i < stats.Length; i++)
     {
         stats[i].ValuesText = statsObject.transform.GetChild(i + 2).GetChild(0).GetComponent <Text>();
         stats[i].LabelText  = statsObject.transform.GetChild(i + 2).GetChild(1).GetComponent <Text>();
         stats[i].CoverImage = statsObject.transform.GetChild(i + 2).GetChild(3).GetChild(1).gameObject;
     }
 }
Ejemplo n.º 12
0
    // Start is called before the first frame update
    void Start()
    {
        Counts = SaveSystem.GetInstance().generalCounts;

        if (Counts.CarinhoIsMorto)
        {
            PortalCarinho.GetComponent <PortalScript>().CanEnter = false;
        }
        if (Counts.TristezaIsMorto)
        {
            PortalTristeza.GetComponent <PortalScript>().CanEnter = false;
        }
        if (Counts.ExpressividadeIsMorto)
        {
            portalExpressividade.GetComponent <PortalScript>().CanEnter = false;
        }
    }
Ejemplo n.º 13
0
 public void NewGame()
 {
     save.NewGame();
     Counts = save.generalCounts;
     foreach (string s in EventKeys)
     {
         Counts.Events.Add(s, true);
         Counts.EventsStrings.Add(s);
         Counts.EventsBools.Add(true);
     }
     foreach (string s in CounterKeys)
     {
         Counts.Stats.Add(s, 0);
         Counts.StatsStrings.Add(s);
         Counts.StatsInts.Add(0);
     }
     LoadingSceneControl.CurrentScene = "Hub";
     SceneManager.LoadScene("LoadingScene", LoadSceneMode.Single);
 }
Ejemplo n.º 14
0
    void Start()
    {
        DF = GetComponent <DisplayFrase>();

        Counts = SaveSystem.GetInstance().generalCounts;

        Level = 0;

        Charger = 0;

        CurrentHP = HitPoints;

        skills = new List <Skills>();

        SkillCD = GetComponent <NewBossSkillCD>();

        PFScript = GetComponent <PunchFloor>();
        Floor    = new Skills(100, PFScript.GetCD(), true, PFScript.Floor);
        skills.Add(Floor);

        PFOScript = GetComponent <PunchFollow>();
        Follow    = new Skills(100, PFOScript.GetCD(), true, PFOScript.Follow);
        skills.Add(Follow);

        PPScript = GetComponent <PunchPrison>();
        Prison   = new Skills(100, PPScript.GetCD(), true, PPScript.Prison);
        //skills.Add(Prison);

        PRScript = GetComponent <PunchRain>();
        Rain     = new Skills(100, 0, true, PRScript.Rain);

        PUScript = GetComponent <PunchUltimate>();
        Ultimate = new Skills(100, 0, true, PUScript.Ultimate);

        anim = GetComponentInChildren <Animator>();

        StartCoroutine(ResetCooldown());
        Platform();
    }
Ejemplo n.º 15
0
 void Start()
 {
     Counts = SaveSystem.GetInstance().generalCounts;
 }
 // Start is called before the first frame update
 void Start()
 {
     _rb    = GetComponent <Rigidbody>();
     anim   = GetComponentInChildren <Animator>();
     Counts = SaveSystem.GetInstance().generalCounts;
 }
Ejemplo n.º 17
0
 public void ClearState()
 {
     generalCounts = GameObject.Instantiate(emptySave);
 }
Ejemplo n.º 18
0
 void Start()
 {
     SceneTheme.Play();
     Counts = SaveSystem.GetInstance().generalCounts;
 }
Ejemplo n.º 19
0
 void Start()
 {
     mp     = Player.GetComponent <MovimentPlayer>();
     Counts = SaveSystem.GetInstance().generalCounts;
 }
Ejemplo n.º 20
0
 void Start()
 {
     Counts = SaveSystem.GetInstance().generalCounts;
     Chat   = ChatBox.transform.GetChild(0).GetComponent <Text>();
     anim   = GetComponentInChildren <Animator>();
 }