Beispiel #1
0
 public AudioClip som;           //SOM
 //private string maoDireita = "Armature/COG/Body_0/backbone1/backbone2/chest/shoulder_R/arm_R/forearm1_R/forearm2_R/palm_R/mid1_R/Item_R";
 void Start()
 {
     anim            = player.GetComponent <Animator>();
     controlScript   = player.GetComponent <ControlePersonagem> ();
     audioSource     = GetComponent <AudioSource>();
     inventario      = player.GetComponent <Inventario> ();
     sceneController = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <CenarioController>();
 }
Beispiel #2
0
    [SerializeField] private string cena = ""; //PROXIMA CENA


    void Start()
    {
        loading.SetActive(false);
        audioSource    = GetComponent <AudioSource>();
        anim           = player.GetComponent <Animator>();
        playerPosition = player.GetComponent <Transform> ();
        controlScript  = player.GetComponent <ControlePersonagem> ();
        //playerControl = player.GetComponent<CharacterController> ();
        sceneController = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <CenarioController>();
    }
    //CENARIO
    public static void SaveSceneData(CenarioController itens)
    {
        CenarioData data = new CenarioData();

        data.itens = new string[itens.itens.Count];
        data.cena  = itens.cena;
        for (int i = 0; i < itens.itens.Count; i++)
        {
            data.itens[i] = itens.itens[i];
        }
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/Temp/Cenario/" + data.cena + ".txt";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Beispiel #4
0
    void OnTriggerEnter(Collider player)
    {
        /*if (player.gameObject.tag == "Player" && Input.GetKeyDown (KeyCode.E)) {
         *      if (inventario.usarItem (chave, "puzzle")) {
         *              Debug.Log ("ABRIU");
         *      } else {
         *              Debug.Log("NÃO TEM CHAVE");
         *      }
         * } */

        CenarioController cenario     = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren <CenarioController> ();
        Inventario        playerItens = player.GetComponent <Inventario> ();

        SaveState.SaveSceneData(cenario);
        SaveState.SavePlayerData(playerItens);
        cenario.LoadScene(cena);
    }