Ejemplo n.º 1
0
 void Start()
 {
     manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();
     background_color.color = background[manager.player_num];
     cLayer.SetActive(false);
     spinLayer.SetActive(false);
     ccLayer.SetActive(false);
     bookLayer.SetActive(false);
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     thirstCoroutine = ThirstTimer();
     hungerCoroutine = HungerTimer();
     StartCoroutine(thirstCoroutine);
     StartCoroutine(hungerCoroutine);
     musicPicker   = FindObjectOfType <MusicPicker> ();
     endgame       = FindObjectOfType <EndGame>();
     displayCanvas = FindObjectOfType <DisplayCanvas> ();
 }
    void OnEnable()
    {
        manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();

        spell_text.text = manager.getSpellText();  // spell text is received from server, and is string

        animator = GetComponent <Animator> ();

        ShowEffect();
    }
Ejemplo n.º 4
0
 void Start()
 {
     startingPosition = transform.localPosition;
     inventory        = GameObject.FindObjectOfType <Inventory>();
     player           = FindObjectOfType <GvrHead>();
     glow             = GetComponent <Glow> ();
     displayCanvas    = FindObjectOfType <DisplayCanvas> ();
     if (glow == null)
     {
         glow = GetComponentInChildren <Glow> ();
     }
 }
    void OnEnable()
    {
        manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();

        foreach (GameObject spell in spells)
        {
            spell.GetComponent <SetSpellData> ().DisplaySpell(false);
        }

        foreach (int i in manager.unlocked_spells)
        {
            spells [i].GetComponent <SetSpellData> ().DisplaySpell(true);
        }
    }
Ejemplo n.º 6
0
    public void ShowCanvas(DisplayCanvas index)
    {
        switch ((int)index)
        {
        case 0:
            HUD.alpha        = 1.0f;
            Scoreboard.alpha = 0.0f;
            GameSetup.alpha  = 0.0f;
            Pause.alpha      = 0.0f;

            Scoreboard.blocksRaycasts = false;
            GameSetup.blocksRaycasts  = false;
            Pause.blocksRaycasts      = false;
            break;

        case 1:
            HUD.alpha        = 0.0f;
            Scoreboard.alpha = 1.0f;
            GameSetup.alpha  = 0.0f;
            Pause.alpha      = 0.0f;

            Scoreboard.blocksRaycasts = true;
            GameSetup.blocksRaycasts  = false;
            Pause.blocksRaycasts      = false;
            break;

        case 2:
            HUD.alpha        = 0.0f;
            Scoreboard.alpha = 0.0f;
            GameSetup.alpha  = 1.0f;
            Pause.alpha      = 0.0f;

            Scoreboard.blocksRaycasts = false;
            GameSetup.blocksRaycasts  = true;
            Pause.blocksRaycasts      = false;
            break;

        case 3:
            HUD.alpha        = 0.0f;
            Scoreboard.alpha = 0.0f;
            GameSetup.alpha  = 0.0f;
            Pause.alpha      = 1.0f;

            Scoreboard.blocksRaycasts = false;
            GameSetup.blocksRaycasts  = false;
            Pause.blocksRaycasts      = true;
            break;
        }
    }
	public virtual void  startApp()
	{
		Displayable current = Display.getDisplay(this).getCurrent();
		if (current == null)
		{
			cameraCanvas = new CameraCanvas(this);
			displayCanvas = new DisplayCanvas(this);
			decodedTextBox = new DecodedTextBox(this);
			Display.getDisplay(this).setCurrent(cameraCanvas);
			cameraCanvas.start();
		}
		else
		{
			if (current == cameraCanvas)
			{
				cameraCanvas.start();
			}
			Display.getDisplay(this).setCurrent(current);
		}
	}
Ejemplo n.º 8
0
    public virtual void  startApp()
    {
        Displayable current = Display.getDisplay(this).getCurrent();

        if (current == null)
        {
            cameraCanvas   = new CameraCanvas(this);
            displayCanvas  = new DisplayCanvas(this);
            decodedTextBox = new DecodedTextBox(this);
            Display.getDisplay(this).setCurrent(cameraCanvas);
            cameraCanvas.start();
        }
        else
        {
            if (current == cameraCanvas)
            {
                cameraCanvas.start();
            }
            Display.getDisplay(this).setCurrent(current);
        }
    }
Ejemplo n.º 9
0
 void FindAngleUI()
 {
     if (displayCanvas == null)
     {
         displayCanvas = (DisplayCanvas)FindObjectOfType(typeof(DisplayCanvas));
         //print ("Display Canvas " + displayCanvas);
         if (displayCanvas != null)
         {
             foreach (Transform child in displayCanvas.transform)
             {
                 //print ("Child name: " + child.gameObject.name);
                 if (child.gameObject.name.Equals("Panel"))
                 {
                     RectTransform panel = child.gameObject.GetComponent <RectTransform>();
                     foreach (Transform child2 in panel.transform)
                     {
                         //print ("Child2 " + child2.gameObject.name);
                         if (child2.name.Equals("RotationObjectText"))
                         {
                             rotationObjectName      = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                             rotationObjectName.text = "Rotation Object";
                         }
                         else if (child2.name.Equals("Angle1"))
                         {
                             angle1 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle2"))
                         {
                             angle2 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle3"))
                         {
                             angle3 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle4"))
                         {
                             angle4 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle5"))
                         {
                             angle5 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle6"))
                         {
                             angle6 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle7"))
                         {
                             angle7 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle8"))
                         {
                             angle8 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle9"))
                         {
                             angle9 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle10"))
                         {
                             angle10 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle11"))
                         {
                             angle11 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle12"))
                         {
                             angle12 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle13"))
                         {
                             angle13 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle14"))
                         {
                             angle14 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle15"))
                         {
                             angle15 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle16"))
                         {
                             angle16 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle17"))
                         {
                             angle17 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle18"))
                         {
                             angle18 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle19"))
                         {
                             angle19 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle20"))
                         {
                             angle20 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle21"))
                         {
                             angle21 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle22"))
                         {
                             angle22 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                         else if (child2.name.Equals("Angle23"))
                         {
                             angle23 = child2.gameObject.GetComponent <UnityEngine.UI.Text>();
                         }
                     }
                 }
                 //					if (child.gameObject.name.Equals (SHOTSTEXT)) {
                 //						shotsText = child.gameObject.GetComponent<UnityEngine.UI.Text> ();
                 //						shotsText.text = "2000";
                 //					}
             }
         }
     }
     angles.Add(angle1);
     angles.Add(angle2);
     angles.Add(angle3);
     angles.Add(angle4);
     angles.Add(angle5);
     angles.Add(angle6);
     angles.Add(angle7);
     angles.Add(angle8);
     angles.Add(angle9);
     angles.Add(angle10);
     angles.Add(angle11);
     angles.Add(angle12);
     angles.Add(angle13);
     angles.Add(angle14);
     angles.Add(angle15);
     angles.Add(angle16);
     angles.Add(angle17);
     angles.Add(angle18);
     angles.Add(angle19);
     angles.Add(angle20);
     angles.Add(angle21);
     angles.Add(angle22);
     angles.Add(angle23);
 }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     anim    = GetComponent <Animator> ();
     manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();
 }
 void OnEnable()
 {
     manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();
 }
 private void Start()
 {
     manager = GameObject.FindGameObjectWithTag("manager").GetComponent <DisplayCanvas>();
 }
Ejemplo n.º 13
0
 void Start()
 {
     screenfader   = FindObjectOfType <ScreenFader> ();
     displayCanvas = FindObjectOfType <DisplayCanvas> ();
     StartCoroutine(displayCanvas.DisplayStartGUI());
 }