Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public static void ResetAllStatic()
 {
     RuntimeInspector.ResetStatic();
     NavigationCamera.ResetStatic();
     GUIChangeBool.ResetStatic();
     DrawEnum.ResetStatic();
     CullGroup.ResetStatic();
     HtmlDebug.ResetStatic();
 }
Esempio n. 3
0
        void OnDestroy()
        {
            if (instance == this)
            {
                instance = null;
            }

            RestoreCam();
        }
        //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;
        }
        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;
        }