Esempio n. 1
0
    private void OnMouseOver()
    {
        ////Right mouse button
        //if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(rotationClockWiseCode))
        //{
        //    canRotateR = true;
        //}

        //Left mouse button
        if (Input.GetMouseButtonDown(0))
        {
            //if (EventSystem.current.IsPointerOverGameObject())
            //{
            //    return;
            //}

            //Record movement sequence
            if (!ReferenceEquals(ShapeMove.selectedShapeMove, this))
            {
                GameBoard.curInfo.AddMoveShapeToSequence(this.shapeInfo.shapeId);
                if (ShapeMove.selectedShapeMove)
                {
                    ShapeMove.selectedShapeMove.ToggleHighLight();
                }
                this.ToggleHighLight();
            }

            ShapeMove.selectedShapeMove = this;
            canRotateL = true;
            //Debug.Log("ShapeMove");
            mZCoord         = Camera.main.WorldToScreenPoint(gameObject.transform.position).z;
            mOffset         = gameObject.transform.position - GetMouseWorldPos();
            currentPosition = this.transform.position;

            //if (Time.time - lastClickTime < catchTime)
            //{
            //    //double click
            //    print("double click done:" + (Time.time - lastClickTime).ToString());
            //    canFlip = true;
            //}
            //else
            //{
            //    //normal click
            //    print("miss:" + (Time.time - lastClickTime).ToString());
            //}
            //lastClickTime = Time.time;
        }

        ////Middle button
        //if (Input.GetMouseButtonDown(2))
        //{
        //    canFlip = true;
        //}
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     rb        = GetComponent <Rigidbody>();
     shapeMove = GetComponent <ShapeMove>();
     if (gameObject.tag != "Player")
     {
         float r = Random.value;
         lonelinessIncreaseRate += r;
     }
     //passingBridge = false;
 }
Esempio n. 3
0
 void Awake()
 {
     mInstance          = this;
     board              = GetComponent <Board> ();
     shapesManager      = GetComponent <ShapesManager> ();
     inputManager       = GetComponent <InputManager> ();
     shapeMove          = GetComponent <ShapeMove> ();
     integrationManager = GetComponent <IntegrationManager> ();
     redimensionManager = GetComponent <RedimensionManager> ();
     combinarManager    = GetComponent <CombinarManager> ();
     levelManager       = GetComponent <LevelManager> ();
 }