/// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            this.config = helper.ReadConfig <BetterSlingshotsConfig>();
            if (this.config.GalaxySlingshotPrice < 0)
            {
                this.config.GalaxySlingshotPrice = new BetterSlingshotsConfig().GalaxySlingshotPrice;
                helper.WriteConfig(this.config);
            }

            this.manager = new SlingshotManager(this.config, helper.Reflection);

            helper.Events.Input.ButtonPressed   += this.OnButtonPressed;
            helper.Events.Input.ButtonReleased  += this.OnButtonReleased;
            helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
            helper.Events.Display.MenuChanged   += this.OnMenuChanged;
        }
        //Projectile ideas
        //Ricochet
        //Homing
        //explode into bullets
        //boomerang
        //auto reload
        //slime

        public override void Entry(IModHelper helper)
        {
            config = helper.ReadConfig <BetterSlingshotsConfig>();
            if (config.GalaxySlingshotPrice < 0)
            {
                config.GalaxySlingshotPrice = new BetterSlingshotsConfig().GalaxySlingshotPrice;
                helper.WriteConfig(config);
            }

            manager = new SlingshotManager(config, helper.Reflection);

            InputEvents.ButtonPressed  += InputEvents_ButtonPressed;
            InputEvents.ButtonReleased += InputEvents_ButtonReleased;
            GameEvents.UpdateTick      += GameEvents_UpdateTick;
            MenuEvents.MenuChanged     += MenuEvents_MenuChanged;
        }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     player   = FindObjectOfType <PlayerStats>();
     sling    = FindObjectOfType <SlingshotManager>();
     startPos = transform.position;
 }
예제 #4
0
 void Start()
 {
     pjboyMovement = GetComponent <PJMovement>();
     slingshot     = GetComponent <SlingshotManager>();
 }
예제 #5
0
 void Awake()
 {
     instance = this;
 }
예제 #6
0
 void Start()
 {
     rb        = GetComponent <Rigidbody2D>();
     slingshot = GetComponent <SlingshotManager>();
 }