public FireBuilder Copy(FireBuilder other)
 {
     data.Copy(other.data);
     modifiers.Clear();
     modifiers.AddRange(other.modifiers);
     positionSource = other.positionSource;
     rotationSource = other.rotationSource;
     targeted       = other.targeted;
     targetPosition = other.targetPosition;
     targetObject   = other.targetObject;
     return(this);
 }
예제 #2
0
        public void Fire(FireBuilder builder, bool useRotation = true)
        {
            Vector2      tempPos = builder.Position;
            DynamicFloat tempRot = builder.Rotation;

            builder.Position = Position;
            if (useRotation)
            {
                builder.Rotation = Rotation;
            }
            builder.Fire();
            builder.Position = tempPos;
            builder.Rotation = tempRot;
        }
예제 #3
0
        public static T Fire <T>(this T danmakus, FireBuilder builder, bool useRotation = true) where T : class, IEnumerable <Danmaku>
        {
            if (danmakus == null)
            {
                return(null);
            }
            if (builder == null)
            {
                throw new System.ArgumentNullException("Fire Builder cannot be null!");
            }
            var          arrayTest = danmakus as Danmaku[];
            Vector2      tempPos   = builder.Position;
            DynamicFloat tempRot   = builder.Rotation;

            if (arrayTest != null)
            {
                for (int i = 0; i < arrayTest.Length; i++)
                {
                    Danmaku danmaku = arrayTest[i];
                    if (danmaku != null)
                    {
                        builder.Position = danmaku.Position;
                        if (useRotation)
                        {
                            builder.Rotation = danmaku.Rotation;
                        }
                        builder.Fire();
                    }
                }
            }
            else
            {
                foreach (var danmaku in danmakus)
                {
                    if (danmaku != null)
                    {
                        builder.Position = danmaku.Position;
                        if (useRotation)
                        {
                            builder.Rotation = danmaku.Rotation;
                        }
                        builder.Fire();
                    }
                }
            }
            builder.Position = tempPos;
            builder.Rotation = tempRot;
            return(danmakus);
        }
        public static FireBuilder ConstructFire(DanmakuPrefab prefab)
        {
            var builder = new FireBuilder(prefab);

            return(builder);
        }
 internal FireBuilder(FireBuilder other)
 {
     data      = new FireData();
     modifiers = new List <DanmakuModifier>();
     Copy(other);
 }