public static GameObject CreateSfx(Vector3 iPosition, SfxPrototype iPrototype) { GameObject obj = (GameObject)GameObject.Instantiate(Active.SfxPrefab, iPosition, Quaternion.identity); Sfx sfx = obj.GetComponent <Sfx>(); sfx.transform.parent = Active.SfxContainer.transform; sfx.Init(iPrototype); return(obj); }
public void ApplyPrototype(SfxPrototype iPrototype) { _prototype = iPrototype; _sprite.sprite = iPrototype._sprite; gameObject.transform.localScale = new Vector3(iPrototype._size, iPrototype._size, iPrototype._size); }
public void Init(SfxPrototype iPrototype) { _sprite = GetComponent <SpriteRenderer>(); ApplyPrototype(iPrototype); }