예제 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #2
0
    ParticleDecalPool GenerateDecalInstance(ParticleDecalPool decal)
    {
        if (decal == null)
        {
            return(null);
        }
        ParticleDecalPool ptDecal = Instantiate(decal);

        ptDecal.transform.parent = decalRoot.transform;
        return(ptDecal);
    }
예제 #3
0
 void PlaceDecal(ParticleDecalPool decal, Vector3 normal, Vector3 pos)
 {
     if (decal != null)
     {
         decal.ParticleHit(normal, pos);
     }
     else
     {
         Debug.Log("<color=yellow>" + this + "</color> some decal not used", this);
     }
 }
예제 #4
0
    // Use this for initialization
    void Awake()
    {
        ptLaunch = GetComponent <ParticleSystem>();

        if (decalRoot == null)
        {
            decalRoot = new GameObject("BulletHole Decals For (" + gameObject.name + ")");
            decalRoot.transform.parent = transform.parent;
        }

        /*****************
        * Create instance
        *****************/
        decalMetal    = GenerateDecalInstance(decalMetal);
        decalConcrete = GenerateDecalInstance(decalConcrete);
        decalGlass    = GenerateDecalInstance(decalGlass);
        decalWood     = GenerateDecalInstance(decalWood);
    }
예제 #5
0
 private void Start()
 {
     particleDecalPool = GameObject.FindGameObjectWithTag("BloodParticles").GetComponent <ParticleDecalPool>();
     shootDuration     = (double)chaingunFireSource.clip.samples / chaingunFireSource.clip.frequency;
     anim = GetComponent <Animator>();
 }
 private void Start()
 {
     particleDecalPool = GameObject.FindGameObjectWithTag("BloodParticles").GetComponent <ParticleDecalPool>();
     anim = transform.GetComponentInParent <Animator>();
 }
예제 #7
0
 private void Start()
 {
     decalPool = new ParticleDecalPool(decalSonar, decalColour, decalSize, maxDecals);
 }