Esempio n. 1
0
    public void Interact(t_DisplayImage currentDisplay)
    {
        currentDisplay.GetComponent <SpriteRenderer>().sprite =
            Resources.Load <Sprite>("Sprites/" + SpriteName);
        currentDisplay.CurrentState = t_DisplayImage.State.ChangedView;

        Camera.main.orthographicSize   = initialCameraSize;
        Camera.main.transform.position = initialCameraPosition;
    }
Esempio n. 2
0
 void ManageObjects()
 {
     for (int i = 0; i < ObjectsToManage.Length; i++)
     {
         if (ObjectsToManage[i].name == currentDisplay.GetComponent <SpriteRenderer>().sprite.name)
         {
             ObjectsToManage[i].SetActive(true);
         }
         else
         {
             ObjectsToManage[i].SetActive(false);
         }
     }
 }
Esempio n. 3
0
    public void OnClickReturn()
    {
        if (currentDisplay.CurrentState == t_DisplayImage.State.zoom)
        {
            GameObject.Find("displayImage").GetComponent <t_DisplayImage>().CurrentState = t_DisplayImage.State.normal;
            var zoomInObjects = FindObjectsOfType <t_ZoomInObject>();
            foreach (var zoomInObject in zoomInObjects)
            {
                zoomInObject.gameObject.layer = 0;
            }

            Camera.main.orthographicSize   = initialCameraSize;
            Camera.main.transform.position = initialCameraPosition;
        }
        else
        {
            currentDisplay.GetComponent <SpriteRenderer>().sprite
                = Resources.Load <Sprite>("Sprites/t_room" + currentDisplay.CurrentRoom);
            currentDisplay.CurrentState = t_DisplayImage.State.normal;
        }
    }
Esempio n. 4
0
 void HideDisplay()
 {
     if (!(currentDisplay.CurrentState == t_DisplayImage.State.normal))
     {
         GetComponent <Image>().color = new Color(GetComponent <Image>().color.r, GetComponent <Image>().color.g,
                                                  GetComponent <Image>().color.b, 0);
         GetComponent <Button>().enabled = false;
         this.transform.SetSiblingIndex(0);
     }
     if (currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_room1") || currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_room2") ||
         currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/roomt_3") || currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_room11") ||
         currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/roomt_12") || currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_room13") ||
         currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_1") || currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_2") ||
         currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_3") || currentDisplay.GetComponent <SpriteRenderer>().sprite == Resources.Load <Sprite>("Sprites/t_,,4"))
     {
         GetComponent <Image>().color = new Color(GetComponent <Image>().color.r, GetComponent <Image>().color.g,
                                                  GetComponent <Image>().color.b, 0);
         GetComponent <Button>().enabled = false;
         this.transform.SetSiblingIndex(0);
     }
 }