示例#1
0
 virtual public void colliderOnClick()
 {
     if (!GamePause.isPause() && (Mathf.Abs(Vector3.Distance(playerObj.transform.position, transform.position)) < maxTouchingDistance))
     {
         Debug.Log("collider Clicked (Event)");
         startFindKey(keyItemName);
     }
 }
示例#2
0
 void OnMouseDown()
 {
     if (!GamePause.isPause())
     {
         Debug.Log("collider clicked");
     }
     transform.parent.gameObject.SendMessage("colliderOnClick");
 }
示例#3
0
 void Update()
 {
     if (GamePause.isPause() && !isPause)
     {
         isPause = true;
         stopWalking();
     }
     else if (!GamePause.isPause() && isPause)
     {
         isPause = false;
         resumeWalking();
     }
 }
示例#4
0
 void colliderOnClick()
 {
     if (!GamePause.isPause() && (Mathf.Abs(Vector3.Distance(playerObj.transform.position, transform.position)) < maxTouchingDistance))
     {
         if (dialogCount < 5)
         {
             startFindKey("key");
         }
         else
         {
             startFindKey("beautifulKey");
         }
     }
 }
示例#5
0
 // Update is called once per frame
 void Update()
 {
     //if (viewDrag == null || (viewDrag && !viewDrag.isDragging)) {
     if (!GamePause.isPause())
     {
         if (target)
         {
             Vector3 point       = camera.WorldToViewportPoint(target.position);
             Vector3 delta       = target.position - camera.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, point.z));            //(new Vector3(0.5, 0.5, point.z));
             Vector3 destination = transform.position + delta;
             if (clampCamera != null)
             {
                 destination = clampCamera.clampDes(destination);
             }
             transform.position = Vector3.SmoothDamp(transform.position, destination, ref velocity, dampTime);
         }
     }
 }
示例#6
0
    void Update()
    {
        Debug.Log("current Scene is:" + currentSceneType);
        if (isSavableScenesTransaction())
        {
            //Debug.Log ("Arrived here checking isPause");

            //			if (!GamePause.isPause ()) {

            Debug.Log("SL System: Change Scene detected, saving...from " + lastSceneType + "to" + currentSceneType);
            lastSceneType = currentSceneType;
            save();
            //		}
        }

        /*		if (isMenu2OtherSceneTransaction ()) {
         *              Debug.Log ("SaveLoadSystem: A scene transaction from MainMenu to some scene was detected.");
         *              lastSceneType = currentSceneType;
         *              load ();
         * }*/

        if (setnCheckCurrentSceneType() && !GamePause.isPause())
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Debug.Log("SaveLoadSystem:Saving the game");
                save();
                lastSceneType    = SceneType.MENU;
                currentSceneType = SceneType.MENU;
                Application.LoadLevel("mainmenu");
            }
            else if (Input.GetKeyDown(KeyCode.E))
            {
                Debug.Log("SaveLoadSystem:Saving the game");
                save();
                lastSceneType    = SceneType.MENU;
                currentSceneType = SceneType.MENU;
                Application.LoadLevel("mainmenu");
            }
        }
    }