private void Awake() { if (instance == null) { instance = this; } }
ParticleDecalPool GenerateDecalInstance(ParticleDecalPool decal) { if (decal == null) { return(null); } ParticleDecalPool ptDecal = Instantiate(decal); ptDecal.transform.parent = decalRoot.transform; return(ptDecal); }
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); } }
// 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); }
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>(); }
private void Start() { decalPool = new ParticleDecalPool(decalSonar, decalColour, decalSize, maxDecals); }