Ejemplo n.º 1
0
 private void Clear()
 {
     SourcePrefab = null;
     NewPrefab    = null;
     _entity      = null;
     _actionFx    = null;
     _loadPool.Store(this);
 }
Ejemplo n.º 2
0
 public void Set(ProjectileConfig config, Entity entity, Vector3 target, Vector3 spawnPos, Quaternion spawnRot, ActionFx actionFx)
 {
     SourcePrefab = config.Prefab;
     _config      = config;
     _entity      = entity;
     _target      = target;
     _spawnPos    = spawnPos;
     _spawnRot    = spawnRot;
     _actionFx    = actionFx;
 }
Ejemplo n.º 3
0
            public ProjectileTemplate(DataEntry data)
            {
                Data              = data;
                ID                = data.ID;
                Type              = data.TryGetValue("Type", data.ID);
                Movement          = data.TryGetValue("Movement", "Simple");
                Speed             = data.TryGetValue("Speed", 0f);
                Rotation          = data.TryGetValue("Rotation", 0f);
                CollisionDistance = data.TryGetValue("CollisionDistance", 0.25f);
                Size              = data.TryGetValue("Size", 0f);
                Length            = data.TryGetValue("Length", 0f);
                Timeout           = data.TryGetValue(DatabaseFields.Timeout, _defaultTimeout.Value);
                GlowPower         = data.TryGetValue("GlowPower", 0f);
                TrailAmount       = data.TryGetValue("TrailAmount", 0);
                TrailFrequency    = data.TryGetValue("TrailFrequency", 0f);
                TrailColor        = data.TryGetValue("TrailColor", Color.black);
                Radius            = ParseUtilities.TryParseEnum(data.GetValue <string>("Radius"), ImpactRadiusTypes.Single);
                Billboard         = ParseUtilities.TryParseEnum(data.GetValue <string>("Billboard"), BillboardMode.FaceCamYDiff);
                MainColor         = data.TryGetValue("MainColor", Color.white);
                OffsetColor       = data.TryGetValue("OffsetColor", Color.white);
                PoolSize          = data.TryGetValue("PoolSize", _defaultPool);
                var afx = data.GetValue <string>(DatabaseFields.ActionFx);

                if (!string.IsNullOrEmpty(afx))
                {
                    ActionFx = ItemPool.LoadAsset <ActionFx>(UnityDirs.ActionFx, afx);
                }
                var model = data.GetValue <string>(DatabaseFields.Model);

                switch (Type)
                {
                default:
                case "Simple":
                    break;

                case "SpherePhysics":
                    if (!string.IsNullOrEmpty(model))
                    {
                        Animation = ItemPool.LoadAsset <SpriteAnimation>(UnityDirs.ActionSpawn, model);
                    }
                    break;

                case "VolumeLaser":
                    Prefab = model;
                    break;
                }
                Components = data.Get(DatabaseFields.Components) as DataList;
            }