Exemplo n.º 1
0
        private static void CopyCat( EffectCategory copy, EffectCategory old, Dictionary<String, EffectCategory> catIndex )
        {
            var copyObj = copy.obj.transform;
            var copyRoot = catIndex[rootName].obj.transform;

            foreach( var child in old.childLoop )
            {
                var copyChild = copyObj.Find( child.name );
                if( copyChild == null )
                {
                    Main.LogE( "Couldn't find child named: " + child.name );
                    continue;
                }
                copy.AddChild( child.Duplicate( copyChild.gameObject, copy ) );
            }

            foreach( var childCat in old.childCatsLoop )
            {
                var path = childCat.path;
                var copyTemp = copyRoot.Find( path );
                if( copyTemp == null )
                {
                    Main.LogE( "Unable to find child at path: " + path );
                    continue;
                }
                var copyCat = new EffectCategory( childCat.name, copyTemp.gameObject, copy );
                catIndex[copyCat.name] = copyCat;
                CopyCat( copyCat, childCat, catIndex );
            }
        }
Exemplo n.º 2
0
        public EffectCategory(String name, GameObject obj, EffectCategory parent)
        {
            this.name   = name;
            this.obj    = obj;
            this.parent = parent;

            this.parent.childCats[name] = this;
        }
Exemplo n.º 3
0
        internal EffectElement(String name, EffectCategory parent)
        {
            this.obj    = new GameObject();
            this.name   = name;
            this.parent = parent;
            parent.AddChild(this);

            this.obj.transform.parent = parent.obj.transform.parent;
            this.scale    = Vector3.one;
            this.position = Vector3.zero;
            this.rotation = Quaternion.identity;
        }
Exemplo n.º 4
0
        private void TransferCategories( GameObject clone )
        {
            var control = clone.AddComponent<BuiltEffectController>();
            var newCats = control.categories;
            var newMain = clone.transform;

            var cats = this.categories;
            var main = cats[rootName].obj.transform;
            var mainCat = cats[rootName];

            var newMainCat = new EffectCategory( clone );
            newCats[rootName] = newMainCat;

            CopyCat( newMainCat, mainCat, newCats );
        }
Exemplo n.º 5
0
 private ParticleElement(ParticleElement orig, GameObject newObj, EffectCategory newParent) : base(orig, newObj, newParent)
 {
     this.partSys  = newObj.GetComponent <ParticleSystem>();
     this.partRend = newObj.GetComponent <ParticleSystemRenderer>();
 }
Exemplo n.º 6
0
 internal ParticleElement(String name, EffectCategory parent) : base(name, parent)
 {
     this.partSys  = base.obj.AddComponent <ParticleSystem>();
     this.partRend = base.obj.AddOrGetComponent <ParticleSystemRenderer>();
 }
Exemplo n.º 7
0
 internal override EffectElement Duplicate(GameObject newObj, EffectCategory newParent)
 {
     return(new ParticleElement(this, newObj, newParent));
 }
Exemplo n.º 8
0
 public EffectCategory(GameObject obj)
 {
     this.name   = EffectBuilder.rootName;
     this.obj    = obj;
     this.parent = null;
 }
Exemplo n.º 9
0
 internal EffectElement(EffectElement orig, GameObject newObj, EffectCategory newParent)
 {
     this.obj    = newObj;
     this.name   = orig.name;
     this.parent = newParent;
 }
Exemplo n.º 10
0
 internal abstract EffectElement Duplicate(GameObject newObj, EffectCategory newParent);