コード例 #1
0
    /// <summary>
    /// 设置是否显示摄像头漂浮UI
    /// </summary>
    /// <param name="isShow"></param>
    private void SetVideoMonitorFollow(bool isShow)
    {
        FollowTargetManage followManage = FollowTargetManage.Instance;

        if (followManage == null)
        {
            return;
        }
        if (isShow)
        {
            followManage.ShowCameraUI();
        }
        else
        {
            followManage.HideCameraUI();
        }
    }
コード例 #2
0
    /// <summary>
    /// 创建建筑信息UI
    /// </summary>
    private void CreateFollowUI()
    {
        //if(FactoryDepManager.currentDep!=null||FactoryDepManager.currentDep as DepController)
        //{
        //    Debug.Log("FollowUI is exist:"+Name);
        //    return;
        //}
        GameObject         targetTagObj = UGUIFollowTarget.CreateTitleTag(gameObject, Vector3.zero);
        FollowTargetManage controller   = FollowTargetManage.Instance;

        if (controller != null && controller.BuildingNameUIPrefab != null)
        {
            if (UGUIFollowManage.Instance == null)
            {
                Debug.LogError("UGUIFollowManage.Instance==null");
                return;
            }
            Camera mainCamera = GetMainCamera();
            if (mainCamera == null)
            {
                return;
            }

            GameObject       name     = UGUIFollowManage.Instance.CreateItem(controller.BuildingNameUIPrefab, targetTagObj, controller.BuildingListName, null, false, true);
            BuildingFollowUI followUI = name.GetComponentInChildren <BuildingFollowUI>(false);

            DisposeFollowTarget dispostTarget = targetTagObj.AddMissingComponent <DisposeFollowTarget>();
            dispostTarget.SetInfo(controller.BuildingListName, name);

            if (followUI)
            {
                followUI.SetUIInfo(Name, Area, Height, FloorNum);
            }

            if (FunctionSwitchBarManage.Instance)
            {
                ToggleButton3 toggle = FunctionSwitchBarManage.Instance.BuildingToggle;
                if (!toggle.ison || FactoryDepManager.currentDep != FactoryDepManager.Instance)
                {
                    UGUIFollowManage.Instance.SetGroupUIbyName(controller.BuildingListName, false);
                }
            }
        }
    }
コード例 #3
0
 // Use this for initialization
 void Awake()
 {
     Instance = this;
 }