Esempio n. 1
0
        public override void OnUpdate()
        {
            attackScript    = (AttackScript)GameObject.Find("WeaponAnimator").GetComponent(typeof(AttackScript));
            selectionScript = (SelectionScript)GameObject.Find("WeaponAnimator").GetComponent(typeof(SelectionScript));
            if (selectionScript.selectedweapon == 1 && (!semiAuto.Value && Input.GetKey(KeyCode.Mouse0)) || (semiAuto.Value && Input.GetKeyDown(KeyCode.Mouse0)))
            {
                switch (projectile.Selected)
                {
                case "BULLET":
                    attackScript.shootbullet(inaccuracy.GetValueFloat(), 1000f, shotNum.GetValueInt(), damage.GetValueFloat(), 1, speed.GetValueFloat(), upPower.GetValueFloat(), doricnoise.Value, ignoreTracers.Value, 1);
                    break;

                case "ARROW":
                    attackScript.throwprojectile(0, speed.GetValueFloat(), shotNum.GetValueFloat(), inaccuracy.GetValueFloat());
                    break;

                case "RIVET":
                    attackScript.throwprojectile(1, speed.GetValueFloat(), shotNum.GetValueFloat(), inaccuracy.GetValueFloat());
                    break;

                default:
                case "MORTAR":
                    attackScript.throwprojectile(2, speed.GetValueFloat(), shotNum.GetValueFloat(), inaccuracy.GetValueFloat());
                    break;
                }
            }
        }