コード例 #1
0
    /// <summary>
    /// Update is called once per frame
    /// </summary>
    private void Update()
    {
        // Get sun object
        GameObject  sun         = GameObject.Find("Sphere");
        SunRotation sunRotation = sun.GetComponent <SunRotation> ();

        // Pass color of sun and world position to shader
        material.SetColor("_PointLightColor", sunRotation.GetColor());
        material.SetVector("_PointLightPosition", sunRotation.GetWorldPosition());
    }
コード例 #2
0
    private void Awake()
    {
        // Move the game object just above the park
        transform.localPosition = new Vector3(-0.5f, 1f, -0.5f);

        // Initialize variables
        nbPointsParkX    = 50;
        nbPointsParkZ    = 100;
        metric           = 0;
        beginningHourCFH = DEFAULT_BEGIN_HOUR;
        endingHourCFH    = DEFAULT_END_HOUR;
        beginningHourSV  = DEFAULT_BEGIN_HOUR;
        endingHourSV     = DEFAULT_END_HOUR;
        sunRotation      = GameObject.Find("Sun").GetComponent <SunRotation>();
    }
コード例 #3
0
ファイル: SceneSaver.cs プロジェクト: Rylern/CitySimulator
 void Awake()
 {
     landmarkVisibility = GameObject.Find("City").GetComponent <LandmarkVisibility>();
     sunRotation        = GameObject.Find("Sun").GetComponent <SunRotation>();
     heatmap            = GameObject.Find("Heatmap").GetComponent <Heatmap>();
 }
コード例 #4
0
 void Awake()
 {
     sunRotation = GameObject.Find("Sun").GetComponent <SunRotation>();
 }