void OnSpawned() { originalPosition = transform.position; if (!firstTime) { decal.Reset(); } firstTime = false; }
//Whenever a EasyDecal command instantiates a decal (either through Project, ProjectAt, Instantiate, etc...), this method will be used to spawn a decal from the EZ_Pooling pool rather than through EasyDecal's method. private static EasyDecal PoolInstantiation(GameObject decalPrefab, GameObject parent, Vector3 position, Quaternion rotation) { string PoolName = decalPrefab.name; EasyDecal clone = EZ_Pooling.EZ_PoolManager.GetPool(PoolName).Spawn(decalPrefab.transform, position, rotation).GetComponent <EasyDecal>(); clone.Reset(true); return(clone); }