示例#1
0
    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);
    }
示例#2
0
 public void ApplyPrototype(SfxPrototype iPrototype)
 {
     _prototype     = iPrototype;
     _sprite.sprite = iPrototype._sprite;
     gameObject.transform.localScale = new Vector3(iPrototype._size, iPrototype._size, iPrototype._size);
 }
示例#3
0
 public void Init(SfxPrototype iPrototype)
 {
     _sprite = GetComponent <SpriteRenderer>();
     ApplyPrototype(iPrototype);
 }