コード例 #1
0
ファイル: NavigationCamera.cs プロジェクト: jonbla/Chess
        void Awake()
        {
            instance = this;

            go = gameObject;
            t  = transform;

            cam = GetComponent <Camera>();

            tStamp = Time.realtimeSinceStartup;

            startPosition = navPosition = t.position;
            startRotation = navRotation = t.rotation;

            navRotation = ResetRotZ(navRotation, false);

            fov = oldFov = cam.fieldOfView;

            selectionIndicatorGO = RuntimeInspector.selectionIndicatorGO;
            selectionIndicatorT  = selectionIndicatorGO.transform;

            if (followTarget)
            {
                ResetFollowPosRot();
            }
        }
コード例 #2
0
 public static void ResetAllStatic()
 {
     RuntimeInspector.ResetStatic();
     NavigationCamera.ResetStatic();
     GUIChangeBool.ResetStatic();
     DrawEnum.ResetStatic();
     CullGroup.ResetStatic();
     HtmlDebug.ResetStatic();
 }
コード例 #3
0
ファイル: NavigationCamera.cs プロジェクト: jonbla/Chess
        void OnDestroy()
        {
            if (instance == this)
            {
                instance = null;
            }

            RestoreCam();
        }
コード例 #4
0
        //void Awake()
        //{
        //    CopyAndCreateTexture(sourceSkin.box.normal.background);

        //    CopyAndCreateTexture(sourceSkin.button.normal.background);
        //    CopyAndCreateTexture(sourceSkin.button.hover.background);
        //    CopyAndCreateTexture(sourceSkin.button.active.background);
        //    CopyAndCreateTexture(sourceSkin.button.onNormal.background);
        //    CopyAndCreateTexture(sourceSkin.button.onHover.background);

        //    CopyAndCreateTexture(sourceSkin.window.normal.background);
        //    CopyAndCreateTexture(sourceSkin.window.onNormal.background);

        //    UnityEditor.AssetDatabase.Refresh();
        //}

        //void CopyAndCreateTexture(Texture2D texRead, float colorMulti = 1)
        //{
        //    string path = UnityEditor.AssetDatabase.GetAssetPath(skin).Replace("Skin.guiskin", texRead.name + ".png");

        //    Texture2D tex = CopyAndRemoveAlphaFromTexture(texRead, colorMulti);

        //    path = Application.dataPath + path.Replace("Assets", "");
        //    // Debug.Log(path);

        //    byte[] bytes = tex.EncodeToPNG();
        //    System.IO.File.WriteAllBytes(path, bytes);
        //}
        public static void ResetStatic()
        {
            onTimeScaleChanged   = null;
            selectionIndicatorGO = null;
            selectedGO           = null;
            navigationCamera     = null;
            namespaceTypesLookup.Clear();
            typeNameLookup.Clear();
            show = false;
        }
コード例 #5
0
        void EnableCamControl()
        {
            if (mainCam == null)
            {
                mainCam = Camera.main;
            }
            if (mainCam == null)
            {
                Debug.LogError("Cannot find the Main Camera. Please tag your Main Camera with the 'MainCamera' tag.");
                useNavigationCamera.Value = false;
                return;
            }

            navigationCamera      = mainCam.gameObject.AddComponent <NavigationCamera>();
            navigationCamera.data = navigationCameraData;
        }