Exemple #1
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(this.gameObject);

            // Initialize
            m_dateTime = DateTime.UtcNow;
            AziLatLon  = AziLatLon;
        }
        else
        {
            //Debug.Log ("Persisted State: " + Instance.gameObject.name + " will be destroyed and " + gameObject.name + " will survive");

            // Persist State Data
            m_dateTime = Instance.m_dateTime;
            AziLatLon  = Instance.m_AziLatLon;

            Destroy(Instance.gameObject);
            Instance = this;
        }
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.LeftControl))
        {
            if (Input.GetKeyDown(KeyCode.Semicolon))
            {
                StarUpdater.Instance.IncrementZoom();
            }
            if (Input.GetKeyDown(KeyCode.Period))
            {
                StarUpdater.Instance.DecrimentZoom();
            }

            if (Input.GetKeyDown(KeyCode.Quote))
            {
                Asterisms.AsterismDrawer.TurnOnAsterisms();
            }
            if (Input.GetKeyDown(KeyCode.Slash))
            {
                Asterisms.AsterismDrawer.TurnOffAsterisms();
            }

            //if( Input.GetKeyDown(KeyCode.LeftBracket) ) {   StarUpdater.Instance.TurnOnLabels(); }
            //if( Input.GetKeyDown(KeyCode.RightBracket) ) {  StarUpdater.Instance.TurnOffLabels(); }

            if (Input.GetKeyDown(KeyCode.O))
            {
                StarUpdater.Instance.IncrementSaturationLevel();
            }
            if (Input.GetKeyDown(KeyCode.K))
            {
                StarUpdater.Instance.DecrimentSaturationLevel();
            }

            if (Input.GetKeyDown(KeyCode.P))
            {
                StarUpdater.Instance.IncrementLuminanceFilter();
            }
            if (Input.GetKeyDown(KeyCode.L))
            {
                StarUpdater.Instance.DecrimentLuminanceFilter();
            }

            if (Input.GetKey(KeyCode.W))
            {
                TimeAndLocationHandler.IncrementLatitude();
            }
            if (Input.GetKey(KeyCode.S))
            {
                TimeAndLocationHandler.DecrimentLatitude();
            }
            if (Input.GetKey(KeyCode.A))
            {
                TimeAndLocationHandler.IncrementLongitude();
            }
            if (Input.GetKey(KeyCode.D))
            {
                TimeAndLocationHandler.DecrimentLongitude();
            }

            if (Input.GetKeyDown(KeyCode.Z))
            {
                TimeAndLocationHandler.IncrementDay();
            }
            if (Input.GetKeyDown(KeyCode.X))
            {
                TimeAndLocationHandler.DecrimentDay();
            }
            if (Input.GetKeyDown(KeyCode.C))
            {
                TimeAndLocationHandler.IncrementHour();
            }
            if (Input.GetKeyDown(KeyCode.V))
            {
                TimeAndLocationHandler.DecrimentHour();
            }
        }
    }
    void Awake()
    {
        if (Instance == null) {
                    Instance = this;
                    DontDestroyOnLoad (this.gameObject);

                    // Initialize
                    m_dateTime = DateTime.UtcNow;
                    AziLatLon = AziLatLon;
                } else {
                    //Debug.Log ("Persisted State: " + Instance.gameObject.name + " will be destroyed and " + gameObject.name + " will survive");

                    // Persist State Data
                    m_dateTime = Instance.m_dateTime;
                    AziLatLon = Instance.m_AziLatLon;

                    Destroy (Instance.gameObject);
                    Instance = this;
                }
    }