Exemple #1
0
 // Start is called before the first frame update
 void Start()
 {
     osc = GetComponent <OSC>();
     osc.SetAddressHandler("/KIN1/Entered/", CrearPersona1);
     osc.SetAddressHandler("/KIN2/Entered/", CrearPersona2);
     gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
 }
Exemple #2
0
    private void Start()
    {
        nextActionTime = 0f;
        intervalo      = 2.5f;

        gV  = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
        osc = GameObject.FindGameObjectWithTag("OSC").GetComponent <OSC>();
    }
Exemple #3
0
    // Start is called before the first frame update
    private void Awake()
    {
        gV  = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
        tag = "comida";

        porcion          = Random.Range(40, 100);
        valorNutricional = Random.Range(-1, 1);
        gusto            = Random.Range(3, 10);
    }
    void Start()
    {
        //Find the matching resource of this gameObject's label, and add the description here
        MGV      = (globalVariables)GameObject.FindGameObjectWithTag("global_variables").GetComponent <globalVariables>();
        bgSprite = gameObject.transform.parent.GetChild(0);        //bg sprite should always be the first index

        name    = MGV.masterResourceList[resourceID].name;
        message = MGV.masterResourceList[resourceID].description;

        message = name + " : " + message;

        //Figure out needed pop up dimensions. Each Line of text should be no more than 40 chars
        //I went overboard with this--GUI.Labels handle word-wrapping so I don't think I need the string list
        //--but this is still useful in getting the number of 'rows' needed for the word wrap
        if (message.Length < 40)
        {
            width  = 400f;
            height = 25f + 10f;
            bgSprite.localScale = Vector3.one;
        }
        else
        {
            //This will get complicated: We need to get the first 40 characters--that ends in a ' ' (space)
            //If the 40th character is not a space, then count backwards until we find one and use that index for the first slice

            for (int i = 0; i < message.Length; i += 100)
            {
                int indexModifier = 0;       //this will be our default
                int newEndIndex   = i + 100; //This will be our default
                //First check if the character in this position is a space ' '
                if (message[i] != ' ')
                {
                    //If it is, then we need to search for the first space counting back from index 40
                    for (int a = 100; a >= 0; a--)
                    {
                        if (message[a] == ' ')
                        {
                            //Figure out the difference of indices we skipped
                            indexModifier = newEndIndex - a;
                            //Set our new split end position to 'a' index
                            newEndIndex = a;
                        }
                    }
                }
                allLines.Add(message.Substring(i, Mathf.Min(newEndIndex, message.Length - i)));
                //Finally apply our index Modifer--essentially we rest 'i' back to the index we found the space
                //	--before it gets incremented another 40 characters
                i -= indexModifier;
            }
            width  = 400f;
            height = (25f * allLines.Count) + 10f;
            bgSprite.localScale += new Vector3(0, allLines.Count, 0);
        }
    }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();

        im  = GetComponent <SpriteRenderer>();
        ani = GetComponent <Animation>();

        ondas = transform.GetChild(0).gameObject;

        transmitiendo = false;
        trackeado     = false;
        ondas.SetActive(false);
    }
    // Start is called before the first frame update
    void Start()
    {
        osc = GetComponent <OSC>();
        osc.SetAddressHandler("/Cam1/Entered/", Cam1TotemEntered);
        osc.SetAddressHandler("/Cam2/Entered/", Cam2TotemEntered);

        osc.SetAddressHandler("/Cam1/Leave/", Cam1TotemLeave);
        osc.SetAddressHandler("/Cam2/Leave/", Cam2TotemLeave);

        osc.SetAddressHandler("/Cam1/Update/", Cam1TotemUpdate);
        osc.SetAddressHandler("/Cam2/Update/", Cam2TotemUpdate);

        osc.SetAddressHandler("/Antena1/Prendida/", PrenderAntena1);
        osc.SetAddressHandler("/Antena2/Prendida/", PrenderAntena2);
        osc.SetAddressHandler("/Antena3/Prendida/", PrenderAntena3);
        osc.SetAddressHandler("/Antena4/Prendida/", PrenderAntena4);

        osc.SetAddressHandler("/Antena1/Apagada/", ApagarAntena1);
        osc.SetAddressHandler("/Antena2/Apagada/", ApagarAntena1);
        osc.SetAddressHandler("/Antena3/Apagada/", ApagarAntena1);
        osc.SetAddressHandler("/Antena4/Apagada/", ApagarAntena1);

        gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
    }
 // Start is called before the first frame update
 void Start()
 {
     l  = GetComponent <Light>();
     gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
 }
Exemple #8
0
 private void Awake()
 {
     gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
 }
 // Start is called before the first frame update
 void Start()
 {
     gV = manager.GetComponent <globalVariables>();
     sovietActualConstruirFabrica = 1;
 }
 // Start is called before the first frame update
 void Start()
 {
     Debug.Log("Starteando");
     gV = GameObject.Find("GlobalManager").GetComponent <globalVariables>();
     unidadesRestantes = Random.Range(10, 20);
 }
 // Use this for initialization
 void Start()
 {
     MGV = GameObject.FindGameObjectWithTag("global_variables").GetComponent <globalVariables>();
 }
 private void Start()
 {
     gV = GameObject.Find("GlobalManger").GetComponent <globalVariables>();
 }