16 кровавые брызги

Первая часть

Вторая часть

ShadowClipper.js

     var shadowProjector : Projector; // the shadow projector
    var shadowDistanceTolerance : float = 0.5; // positive number used to cast shadow on terrains correctly
    private var origNearClipPlane : float;
    private var origFarClipPlane : float;
    function Start() {
    if(!shadowProjector) shadowProjector = transform.GetComponentInChildren.<Projector>();
    origNearClipPlane = shadowProjector.nearClipPlane;
    origFarClipPlane = shadowProjector.farClipPlane;
    Late();
    //Update
    }
    function Update() {
    }
    function Late()
    {
        var ray = new Ray(shadowProjector.transform.position
    + shadowProjector.transform.forward.normalized * origNearClipPlane,
    shadowProjector.transform.forward);
    var hit : RaycastHit;
    if (Physics.Raycast (ray, hit, origFarClipPlane - origNearClipPlane,
    ~shadowProjector.ignoreLayers)) 
    {
  	  var dist = hit.distance + origNearClipPlane;
  	  shadowProjector.nearClipPlane = Mathf.Max(dist - shadowDistanceTolerance, 0);
    	shadowProjector.farClipPlane = dist + shadowDistanceTolerance;
   	 }
    }

RandomRotation.cs

using UnityEngine;
using System.Collections;

public class RandomRotation : MonoBehaviour 
{
	void Start () 
	{
		transform.rotation = Quaternion.AngleAxis(Random.Range(0,360),transform.forward) * transform.rotation;
	}
}

Текстуры:
Blood TextureBlood Texture pngBlood Splatter TextureBlood Splatter Texture

Falloff

Оставить комментарий