Beispiel #1
0
        public void Emit(string effectName, Vector3 position)
        {
            VFXData effect = Array.Find(effectsCollection, x => x.name == effectName);

            if (effect == null)
            {
                Debug.LogErrorFormat("Effect with name {0} wasn't found!", effectName);
                return;
            }

            PoolManager.Instantiate(effect.prefab, position, effect.prefab.transform.rotation);
        }
Beispiel #2
0
        public override void Import(string _collection, ResourceData[] _resources)
        {
            VFXData[] coll = new VFXData[_resources.Length];

            for (int i = 0; i < _resources.Length; i++)
            {
                VFXData data = new VFXData();
                data.name   = _resources[i].name;
                data.prefab = _resources[i].o as GameObject;

                coll[i] = data;
            }

            GetType().GetField(_collection).SetValue(this, coll);
        }