Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        readScript             = new ReadScript();
        headObjects            = new List <ObjectInfo>();
        leftControllerObjects  = new List <ObjectInfo>();
        rightControllerObjects = new List <ObjectInfo>();

        GameObject parent = new GameObject("Tranformer");

        headGameObject            = new GameObject("Head");
        leftControllerGameObject  = new GameObject("ControllerLeft");
        rightControllerGameObject = new GameObject("ControllerRight");

        //Just for sanity in the editor
        headGameObject.transform.SetParent(parent.transform);
        leftControllerGameObject.transform.SetParent(parent.transform);
        rightControllerGameObject.transform.SetParent(parent.transform);

        GameObject cameraRig = GameObject.Find("[CameraRig]");

        cameraEye       = cameraRig.transform.FindChild("Camera (eye)");
        controllerLeft  = cameraRig.transform.FindChild("Controller (left)");
        controllerRight = cameraRig.transform.FindChild("Controller (right)");

        scores   = new List <List <float> >();
        ioWriter = new IOScript();

        //readData();

        //generateDataset();

        //deleteCollections(ref currentNumberOfCollections);
    }
Esempio n. 2
0
	// Use this for initialization
	void Start () {
		sol = GetComponent<ManagerSolucion> ();
		read = GetComponent<ReadScript> ();

        cargarJsonEscena();

    }
Esempio n. 3
0
    public void chooseItem(int index)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      file;

        string[] currentInv = ReadScript.Read <string[]> ("Inventory");
        if (currentInv == default(string[]))
        {
            currentInv = new string[0];
        }
        string[] newInv = new string[currentInv.Length + lm.items.Length];
        int      i      = 0;

        foreach (string name in currentInv)
        {
            newInv [i] = currentInv [i++];
        }
        newInv [i++] = lm.items[index].name.Replace("(Clone)", "");

        foreach (Button button in lm.itemSlots)
        {
            button.gameObject.SetActive(false);
        }
        lm.lootText.text = lm.items [index].itemName + " added to Inventory.";
        lm.HideTooltip();

        file = File.Create(Application.persistentDataPath + "/Inventory.dat");
        bf.Serialize(file, newInv);
        file.Close();
        //Save progress
        GameObject.Find("ShapesManager").GetComponent <ShapesManager> ().SaveProgress();
        ContinueButton.interactable = true;
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        biggestTemplate = 0;

        readScript             = new ReadScript();
        headObjects            = new List <GestureDetection.ObjectInfo>();
        leftControllerObjects  = new List <GestureDetection.ObjectInfo>();
        rightControllerObjects = new List <GestureDetection.ObjectInfo>();
        templateNames          = new List <string>();
        headData              = new List <RecordedData>();
        leftData              = new List <RecordedData>();
        rightData             = new List <RecordedData>();
        headExpandedTemplate  = new List <List <Pair <List <Vector3>, int> > >();
        leftExpandedTemplate  = new List <List <Pair <List <Vector3>, int> > >();
        rightExpandedTemplate = new List <List <Pair <List <Vector3>, int> > >();

        readTemplates();

        generateDataset();

        deleteCollections(ref currentNumberOfCollections);

        generateTemplate();

        for (int i = 0; i < headObjects.Count; i++)
        {
            //Don't know if I need this, check later
            if (headObjects[i].resetRotPos.Count > biggestTemplate)
            {
                biggestTemplate = headObjects[i].resetRotPos.Count;
            }
            headExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
            leftExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
            rightExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
        }

        //expandTemplates();

        //Add these three lines, remove expandTemplates() above and only have 1 template in the template folder to only have 1 template
        //headExpandedTemplate[0].Add(new Pair<List<Vector3>, int>(headObjects[0].positiveVec, headObjects[0].positiveVec.Count));
        //leftExpandedTemplate[0].Add(new Pair<List<Vector3>, int>(leftControllerObjects[0].positiveVec, leftControllerObjects[0].positiveVec.Count));
        //rightExpandedTemplate[0].Add(new Pair<List<Vector3>, int>(rightControllerObjects[0].positiveVec, rightControllerObjects[0].positiveVec.Count));

        for (int i = 0; i < headExpandedTemplate.Count; i++)
        {
            headExpandedTemplate[i].Add(new Pair <List <Vector3>, int>(headObjects[i].positiveVec, headObjects[i].positiveVec.Count));
            leftExpandedTemplate[i].Add(new Pair <List <Vector3>, int>(leftControllerObjects[i].positiveVec, leftControllerObjects[i].positiveVec.Count));
            rightExpandedTemplate[i].Add(new Pair <List <Vector3>, int>(rightControllerObjects[i].positiveVec, rightControllerObjects[i].positiveVec.Count));
        }

        for (int i = 0; i < headExpandedTemplate.Count; i++)
        {
            if (headExpandedTemplate[i][headExpandedTemplate[i].Count - 1].second > biggestTemplate)
            {
                biggestTemplate = headExpandedTemplate[i][headExpandedTemplate[i].Count - 1].second;
            }
        }
        //recordedData = new List<List<Vector3>>();
    }
Esempio n. 5
0
  	// Use this for initialization
	void Start () {
		rs = GetComponent<ReadScript> ();
		answers = GameObject.Find ("Answers");
		tg =answers.GetComponent<ToggleGroup>();

        tgg = tg.GetComponentsInChildren<Toggle>();

 	}
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     statText.text  = "Number of days: " + PlayerPrefs.GetInt("Days") + "1.\n";
     statText.text += "Equipment used to defeat Ace of Spades: ";
     foreach (string item in ReadScript.Read <string[]>("Equipment"))
     {
         statText.text += (item != null?(item + "\n "):"");
     }
     int[] level = ReadScript.Read <int[]> ("PlayerXP");
     statText.text += "\n Final level acquired: " + (level == default(int[])?1:level [0]) + ".\n";
 }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        readScript             = new ReadScript();
        headObjects            = new List <ObjectInfo>();
        leftControllerObjects  = new List <ObjectInfo>();
        rightControllerObjects = new List <ObjectInfo>();

        //readData();

        //generateDataset();

        //deleteCollections(ref currentNumberOfCollections);
    }
Esempio n. 8
0
    void Awake()
    {
        level = (GetComponentInChildren <Text>().name.Contains("Encounter")?int.Parse(GetComponentInChildren <Text>().text):1);
        damageMultiplier.value += 20 * (level - 1);
        List <string> encountersDefeated = ReadScript.Read <List <string> >("Progress");

        if (encountersDefeated == default(List <string>))
        {
            return;
        }
        if (encountersDefeated.Contains(this.encounterName) && SceneManager.GetActiveScene().name == "Location Selection")
        {
            this.GetComponent <Image> ().color = Color.green;
            defeated = true;
        }
    }
Esempio n. 9
0
 void Awake()
 {
     hintText = hintPanel.GetComponentInChildren <Text> ();
     em       = GetComponent <EquipmentManager> ();
     XP       = ReadScript.Read <int[]> ("PlayerXP");
     if (XP == default(int[]))
     {
         XP    = new int[2];
         XP[0] = 1;
         XP[1] = 0;
     }
     GetComponent <CharacterStats>().maximumHP = Mathf.RoundToInt(300f * (float)Mathf.Pow(1.2f, XP[0] - 1));
     GetComponent <CharacterStats>().removeAllModifiers();
     GetComponent <CharacterStats>().damageMultiplier.setValue(Mathf.RoundToInt(100f * (float)Mathf.Pow(1.2f, XP[0] - 1)) - 100);
     em.AwakeOnFight();
 }
    // Use this for initialization
    void Start()
    {
        biggestTemplate = 0;

        readScript             = new ReadScript();
        headObjects            = new List <GestureDetection.ObjectInfo>();
        leftControllerObjects  = new List <GestureDetection.ObjectInfo>();
        rightControllerObjects = new List <GestureDetection.ObjectInfo>();
        templateNames          = new List <string>();
        headData              = new List <RecordedData>();
        leftData              = new List <RecordedData>();
        rightData             = new List <RecordedData>();
        headExpandedTemplate  = new List <List <Pair <List <Vector3>, int> > >();
        leftExpandedTemplate  = new List <List <Pair <List <Vector3>, int> > >();
        rightExpandedTemplate = new List <List <Pair <List <Vector3>, int> > >();

        readTemplates();

        generateDataset();

        deleteCollections(ref currentNumberOfCollections);

        generateTemplate();

        for (int i = 0; i < headObjects.Count; i++)
        {
            //Don't know if I need this, check later
            if (headObjects[i].resetRotPos.Count > biggestTemplate)
            {
                biggestTemplate = headObjects[i].resetRotPos.Count;
            }
            headExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
            leftExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
            rightExpandedTemplate.Add(new List <Pair <List <Vector3>, int> >());
        }

        expandTemplates();
        for (int i = 0; i < headExpandedTemplate.Count; i++)
        {
            if (headExpandedTemplate[i][headExpandedTemplate[i].Count - 1].second > biggestTemplate)
            {
                biggestTemplate = headExpandedTemplate[i][headExpandedTemplate[i].Count - 1].second;
            }
        }
        //recordedData = new List<List<Vector3>>();
    }
Esempio n. 11
0
    public void Load(string name)
    {
        string[] itemNames = ReadScript.Read <string[]> (name);
        if (itemNames == default(string[]))
        {
            return;
        }

        this.items = new Item[itemNames.Length];
        for (int i = 0; i < itemNames.Length; i++)
        {
            if (itemNames [i] != null)
            {
                GameObject newItem = (GameObject)Instantiate(Resources.Load("Items/" + itemNames [i]));
                this.items [i] = newItem.GetComponent <Item> ();
            }
        }
    }
Esempio n. 12
0
    public void SaveProgress()
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      file;
        List <string>   encountersDefeated = ReadScript.Read <List <string> > ("Progress");

        if (encountersDefeated == default(List <string>))
        {
            encountersDefeated = new List <string> ();
        }
        if (EnemySelection.created)
        {
            encountersDefeated.Add(EnemySelection.Instance.encounterName);
        }

        file = File.Create(Application.persistentDataPath + "/Progress.dat");
        bf.Serialize(file, encountersDefeated);

        file.Close();
    }
Esempio n. 13
0
 public KrakatuaViewModel()
 {
     Messenger.Default.Register <SelectAttraction>(this, SelectAttractionMethod);
     readScript = new ReadScript();
 }
Esempio n. 14
0
	// Use this for initialization
	void Start () {
		read = GetComponent<ReadScript> ();
	}
Esempio n. 15
0
 	// Use this for initialization
	void Start () {
		rs = GetComponent<ReadScript> ();
		answers = GameObject.Find ("Answers");
	}