Example #1
0
    private void OnMouseDrag()
    {
        if (!MainGameLogic.IsMainGame())
        {
            return;
        }
        if (!manager.IsPerformingAction())
        {
            if (startCubeTile == null || startFace == null)
            {
                startCubeTile = manager.QueryFirstCubeTile();
                startFace     = manager.QueryMagicCubeFace();

                if (startCubeTile != null && startFace != null)
                {
                    Vector3 temp = manager.GetWorldPos();
                    if (temp != Vector3.positiveInfinity)
                    {
                        mouseDragStartPos = temp;
                    }
                }
            }

            if (startCubeTile != null && startFace != null)
            {
                Vector3 temp = manager.GetWorldPos();
                if (!float.IsInfinity(temp.x))
                {
                    currentDragPos = temp;
                }
            }
        }
    }
Example #2
0
 private void OnApplicationQuit()
 {
     if (MainGameLogic.IsMainGame() || MainGameLogic.IsGameMenu())
     {
         if (manager != null && !manager.IsPerformingAction())
         {
             manager.Save();
         }
     }
 }