Пример #1
0
    private void OnTheGUI()
    {
        if (m_Button1.HitTest(Input.mousePosition))
        {
            m_Button1.GetComponent <ChangeTextureHover>().ChangeToHoverTexture();
        }
        else
        {
            m_Button1.GetComponent <ChangeTextureHover>().ChangeBack();
        }
        if (m_Button2.HitTest(Input.mousePosition))
        {
            m_Button2.GetComponent <ChangeTextureHover>().ChangeToHoverTexture();
        }
        else
        {
            m_Button2.GetComponent <ChangeTextureHover>().ChangeBack();
        }

        if (m_Button1.HitTest(Input.mousePosition) && Input.GetMouseButtonDown(0))
        {
            EndMenu();
            RasmusGameSave.SaveLevel();
            Application.LoadLevel(m_Scene);
        }
        if (m_Button2.HitTest(Input.mousePosition) && Input.GetMouseButtonDown(0))
        {
            EndMenu();
        }
    }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (gameObject.activeInHierarchy)
     {
         //if(Camera.main.GetComponent<RasmusRaycast>().m_HoldingAnObject)
         //{
         //	Camera.main.GetComponent<RasmusRaycast>().HoldObject.AddComponent<DontStoreObjectInRoom>();
         //	RasmusGameSave.m_HoldingObject = true;
         //	//RasmusGameSave.m_Data = LevelSerializer.SaveObjectTree(Camera.main.GetComponent<RasmusRaycast>().HoldObject);
         //	//Destroy(Camera.main.GetComponent<RasmusRaycast>().HoldObject);
         //}
         //else
         //{
         //	RasmusGameSave.m_HoldingObject = false;
         //}
         ////else
         ////{
         ////	RasmusGameSave.m_HoldingObject = false;
         ////}
         RasmusGameSave.m_SpawnPosition = m_SpawnPosition;
         RasmusGameSave.SaveLevel();
         //RoomManager.SaveCurrentRoom();
         //RoomManager.LoadRoom(m_Level);
         Application.LoadLevel(m_Level);
         gameObject.SetActive(false);
     }
 }