Ejemplo n.º 1
0
 public static void RegisterCamera(LabCamera cam)
 {
     if (cam != null)
     {
         m_lLabCam.Add(cam);
     }
 }
Ejemplo n.º 2
0
 public static void UnRegisterCamera(LabCamera cam)
 {
     if (cam != null)
     {
         m_lLabCam.Remove(cam);
     }
 }
Ejemplo n.º 3
0
    public void Initialize(int level, int[][] lightGears, int[] levelBits, string[] levelTimes, int totalLightGears)
    {
        startPos    = levelsParent.localPosition;
        labCamera   = FindObjectOfType <LabCamera>();
        activeLevel = level;
        for (int i = 0; i < levels.Length; i++)
        {
            if (levels[i] != null)
            {
                levels[i].Initialize(lightGears[i], levelBits[i], levelTimes[i]);
            }
        }
        int tempLightGears = totalLightGears;

        if (totalLightGears >= 100)
        {
            totalGears100sColumn[0].SetActive(false);
            totalGears100sColumn[totalLightGears / 100].SetActive(true);
            tempLightGears -= 100;
        }
        if (tempLightGears >= 10)
        {
            totalGears10sColumn[0].SetActive(false);
            totalGears10sColumn[tempLightGears / 10].SetActive(true);
            tempLightGears -= 10;
        }
        if (tempLightGears >= 1)
        {
            totalGears1sColumn[0].SetActive(false);
            totalGears1sColumn[tempLightGears].SetActive(true);
        }
    }
Ejemplo n.º 4
0
    private void SetDraggedPosition(PointerEventData data)
    {
        Vector3 globalMousePos;

        CameraType type = m_labObject != null && m_labObject is EleLine ? CameraType.WireCamera : CameraType.LabCamera;

        LabCamera carme = LabEnv.GetCameraByType(type);

        if (carme != null && carme.ScreenPointToWorldPointInRectangle(m_DraggingPlane, data.position, out globalMousePos))
        {
            Vector3 org = m_DraggingItem.transform.position;
            globalMousePos = U3DUtil.SetZ(globalMousePos, m_DraggingItem.transform.position.z);

            m_DraggingItem.transform.position = globalMousePos;
            if (m_labObject != null && m_labObject is EleLine)
            {
                bool startOut = carme.CheckPositionInCamera((m_labObject as EleLine).m_LineAction.m_StartCtrl.transform.position);
                bool EndOut   = carme.CheckPositionInCamera((m_labObject as EleLine).m_LineAction.m_EndCtrl.transform.position);
                if (!startOut || !EndOut)
                {
                    m_DraggingItem.transform.position = org;
                }
            }
            else if (!carme.CheckPositionInCamera(globalMousePos))
            {
                m_DraggingItem.transform.position = org;
            }
        }
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     gameSaver = GameSaver.instance;
     labCamera = FindObjectOfType <LabCamera>();
     startPos  = transform.localPosition;
     gunsParent.localPosition  = new Vector3(startPos.x - (gameSaver.activeGun - 1) * 3, startPos.y, startPos.z);
     shipsParent.localPosition = new Vector3(startPos.x - (gameSaver.activeShip - 1) * 3, startPos.y, startPos.z);
 }
Ejemplo n.º 6
0
    void Start()
    {
        if (m_labObject == null)
        {
            m_labObject = GetComponent <NDlabObject>();
        }

        if (m_labObject != null)
        {
            LabObjectOperateCenter.RegeditMove(this, m_labObject);
            if (m_labObject is EleLine)
            {
                m_labCamera = LabEnv.GetCameraByType(CameraType.WireCamera);
            }
            else
            {
                m_labCamera = LabEnv.GetCameraByType(CameraType.LabCamera);
            }
        }
    }
Ejemplo n.º 7
0
 void Awake()
 {
     m_camera = LabEnv.GetCameraByType(CameraType.WireCamera);
 }
Ejemplo n.º 8
0
 void Start()
 {
     InitCtrlLine();
     wireCamera = LabEnv.GetCameraByType(CameraType.WireCamera);
 }