Пример #1
0
    private StelController controller;  // This finds the related script providing communication to Stellarium.

    void Awake()
    {
        // just initialize the controller. That script must be attached to the same gameObject.
        controller = gameObject.GetComponent <StelController>();
        if (controller == null)
        {
            Debug.LogWarning("StelMouseZoom: Cannot find StelController!");
        }
    }
Пример #2
0
 void Awake()
 {
     // just initialize the controller...
     controller = gameObject.GetComponent <StelController>();
     if (controller == null)
     {
         Debug.LogWarning("StelKeyboardTriggers: Cannot find StelController! controller not initialized");
     }
     streamingSkybox = gameObject.GetComponent <StreamingSkybox>();
     if (streamingSkybox == null)
     {
         Debug.LogWarning("StelKeyboardTriggers: Cannot find StreamingSkybox! streamingSkybox not initialized");
     }
 }
Пример #3
0
    FileSystemWatcher watcher;          // The watcher is used to check for updates in the skybox tiles directory. As soon as a new skybox has been generated, Skybox and SunLight will be updated.
#endif

    private void Awake()
    {
        skyName = defaultSkyname;
        // prepare Material dictionary
        sides.Add("Unity1-north.png", null);
        sides.Add("Unity2-east.png", null);
        sides.Add("Unity3-south.png", null);
        sides.Add("Unity4-west.png", null);
        sides.Add("Unity5-top.png", null);
        sides.Add("Unity6-bottom.png", null);
        pathBase = System.IO.Path.Combine(Application.streamingAssetsPath, "SkyBoxes/");
        Debug.Log("StreamingSkybox: pathbase=" + pathBase);
        controller = gameObject.GetComponent <StelController>();
#if !UNITY_WEBGL
        watcher = new FileSystemWatcher();
#endif
    }
Пример #4
0
 void Awake()
 {
     controller = gameObject.GetComponent <StelController>();
     if (!controller)
     {
         Debug.LogError("StelSkyBox: Cannot find StelController. Scene setup wrong!");
     }
     // GZ: I find this not necessary. Maybe move this to StelController?
     // Application.runInBackground = true;
     sides.Add("Unity1-north.png", null);
     sides.Add("Unity2-east.png", null);
     sides.Add("Unity3-south.png", null);
     sides.Add("Unity4-west.png", null);
     sides.Add("Unity5-top.png", null);
     sides.Add("Unity6-bottom.png", null);
     watcher = new FileSystemWatcher();
 }
Пример #5
0
    private GameObject sunImpostorSphere; // used in Skybox mode to display a visible sphere when looking through instruments.

    private void Awake()
    {
        // just initialize the controller...
        controller = gameObject.GetComponent <StelController>();
        if (controller == null)
        {
            Debug.LogWarning("StelLight: Cannot find StelController! controller not initialized");
        }

        //Check to see if we have a sun linked to our public variable; if not, create one
        stelLight = gameObject.GetComponent <Light>();
        if (stelLight == null)
        {
            stelLight = gameObject.AddComponent <Light>();
        }

        stelLight.type = LightType.Directional;              // GZ: This was commented out. It should be set directional, however (set in inspector)
                                                             //stelLight.flare = sunFlare;
                                                             //stelLight.shadows = shadowType;

        sunImpostorSphere = transform.Find(name: "LightImpostorSphere").gameObject;
    }