コード例 #1
0
        void Start()
        {
            if (version < 180)
            {
                directionalIntensity = directionalIntensity * (int)directionalMode;
                version = 180;
            }

            volumeCollider = GetComponent <Collider>();

            if (volumeCollider == null)
            {
                Debug.Log("[Atmospheric Height Fog] Please create override volumes from the GameObject menu > BOXOPHOBIC > Atmospheric Height Fog > Override!");
                DestroyImmediate(this);
            }

            if (GameObject.Find("Height Fog Global") != null)
            {
                GameObject globalFogGO = GameObject.Find("Height Fog Global");
                globalFog = globalFogGO.GetComponent <HeightFogGlobal>();

                messageNoHeightFogGlobal = false;
            }
            else
            {
                messageNoHeightFogGlobal = true;
            }

            GetDirectional();

            localMaterial      = new Material(Shader.Find("BOXOPHOBIC/Atmospherics/Height Fog Preset"));
            localMaterial.name = "Local";

            missingMaterial = Resources.Load <Material>("Height Fog Preset");

            SetLocalMaterial();
        }
コード例 #2
0
 void OnEnable()
 {
     targetScript = (HeightFogGlobal)target;
 }