Exemplo n.º 1
0
        public static BallisticProjectile CreateNew(EntityInstancePlugin plugin, ILevelManager level)
        {
            var newInstance = new BallisticProjectile(level);

            plugin.Entity.AddComponent(newInstance);
            return(newInstance);
        }
Exemplo n.º 2
0
        public static Clicker CreateNew(EntityInstancePlugin plugin, ILevelManager level)
        {
            var newInstance = new Clicker(level);

            plugin.Entity.AddComponent(newInstance);

            return(newInstance);
        }
Exemplo n.º 3
0
        public static StaticRangeTarget CreateNew(EntityInstancePlugin plugin, ILevelManager level, Vector3 position)
        {
            var newInstance = new StaticRangeTarget(level, position);

            ((LevelManager)level).RegisterRangeTarget(newInstance);
            plugin.Entity.AddComponent(newInstance);

            return(newInstance);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates new instance of a shooter and attaches it to the Entity and it's node.
        /// </summary>
        /// <param name="plugin">Plugin of the entity</param>
        /// <param name="level">Current level.</param>
        /// <param name="projectileType">Type of the projectile to shoot.</param>
        /// <param name="sourceOffset">Offset of the source of projectiles from the Entity Node.</param>
        /// <param name="rateOfFire">Rate of fire in number of projectiles per minute.</param>
        /// <returns>The newly created instance of Shooter.</returns>
        public static Shooter CreateNew(EntityInstancePlugin plugin,
                                        ILevelManager level,
                                        ProjectileType projectileType,
                                        Vector3 sourceOffset,
                                        float rateOfFire)
        {
            var newInstance = new Shooter(level,
                                          projectileType,
                                          sourceOffset,
                                          rateOfFire);

            plugin.Entity.AddComponent(newInstance);
            return(newInstance);
        }