Beispiel #1
0
        public static Transform applyEffect(Transform model, ushort mythicID, EEffectType type)
        {
            if (mythicID == 0)
            {
                return(null);
            }
            if (model == null)
            {
                return(null);
            }
            Transform transform    = model.FindChild("Effect");
            Transform effectSystem = ItemTool.getEffectSystem(mythicID, type);

            if (effectSystem != null)
            {
                if (transform != null)
                {
                    effectSystem.parent = transform;
                    MythicLockee mythicLockee = effectSystem.gameObject.AddComponent <MythicLockee>();
                    MythicLocker mythicLocker = transform.gameObject.AddComponent <MythicLocker>();
                    mythicLocker.system = mythicLockee;
                    mythicLockee.locker = mythicLocker;
                }
                else
                {
                    effectSystem.parent = model;
                    MythicLockee mythicLockee2 = effectSystem.gameObject.AddComponent <MythicLockee>();
                    MythicLocker mythicLocker2 = model.gameObject.AddComponent <MythicLocker>();
                    mythicLocker2.system = mythicLockee2;
                    mythicLockee2.locker = mythicLocker2;
                }
                effectSystem.localPosition = Vector3.zero;
                effectSystem.localRotation = Quaternion.identity;
            }
            return(effectSystem);
        }