예제 #1
0
    private void InitializeDrawer(FlowRainDrawerContainer dc)
    {
        dc.TimeElapsed             = 0f;
        dc.lifetime                = RainDropTools.Random(Variables.LifetimeMin, Variables.LifetimeMax);
        dc.fluctuationRate         = RainDropTools.Random(Variables.fluctuationRateMin, Variables.fluctuationRateMax);
        dc.acceleration            = RainDropTools.Random(Variables.AccelerationMin, Variables.AccelerationMax);
        dc.transform.localPosition = RainDropTools.GetSpawnLocalPos(this.transform, camera, 0f, Variables.SpawnOffsetY);
        dc.startPos                = dc.transform.localPosition;

        dc.acceleration = RainDropTools.Random(Variables.AccelerationMin, Variables.AccelerationMax);
        Material mat = RainDropTools.CreateRainMaterial(ShaderType, RenderQueue);

        RainDropTools.ApplyRainMaterialValue(
            mat,
            ShaderType,
            Variables.NormalMap,
            Variables.OverlayTexture,
            Variables.DistortionValue,
            Variables.OverlayColor,
            Variables.ReliefValue,
            Variables.Blur,
            Variables.Darkness
            );
        dc.Drawer.lifeTime        = dc.lifetime;
        dc.Drawer.vertexDistance  = 0.01f;
        dc.Drawer.angleDivisions  = 20;
        dc.Drawer.material        = mat;
        dc.Drawer.widthCurve      = Variables.TrailWidth;
        dc.Drawer.widthMultiplier = RainDropTools.Random(Variables.SizeMinX, Variables.SizeMaxX);
        dc.Drawer.textureMode     = LineTextureMode.Stretch;
        dc.Drawer.vertexDistance  = (1f * this.Distance * RainDropTools.GetCameraOrthographicSize(this.camera).y) / (Variables.Resolution * 10f);
        dc.Drawer.Clear();
        dc.Drawer.enabled = false;
    }
예제 #2
0
 private void InitializeDrawer(SimpleRainDrawerContainer dc)
 {
     dc.TimeElapsed             = 0f;
     dc.lifetime                = RainDropTools.Random(Variables.LifetimeMin, Variables.LifetimeMax);
     dc.transform.localPosition = RainDropTools.GetSpawnLocalPos(this.transform, camera, 0f, Variables.SpawnOffsetY);
     dc.startPos                = dc.transform.localPosition;
     dc.startSize               = new Vector3(
         RainDropTools.Random(Variables.SizeMinX, Variables.SizeMaxX),
         RainDropTools.Random(Variables.SizeMinY, Variables.SizeMaxY),
         1f
         );
     dc.transform.localEulerAngles += Vector3.forward * (Variables.AutoRotate ? UnityEngine.Random.Range(0f, 179.9f) : 0f);
     dc.Drawer.NormalMap            = Variables.NormalMap;
     dc.Drawer.ReliefTexture        = Variables.OverlayTexture;
     dc.Drawer.Darkness             = Variables.Darkness;
     dc.Drawer.Hide();
 }