void Update()
    {
        if (!downing && GameController.State == GameState.Playing)
        {
            Controller();
        }

        if (GameController.State == GameState.Playing)
        {
            if (once)
            {
                killData = new KillData(name, 0);
                gameController.killList.Add(killData);
                once = false;
            }

            Fire();
            GameOverCheck();
            Kill();
            if (killData.kill > currentKill && Too.GetData <bool>(Data.killScale) && !downing)
            {
                Scale();
                TapticPlugin.TapticManager.Impact(TapticPlugin.ImpactFeedback.Heavy);
            }

            canvasController.textHudKillNum.text = "kill : " + (killData.name == name ? killData.kill : 0).ToString();
        }

        if (downing)
        {
            desiredPos = Input.mousePosition - mouseStartPos;
            lookPos    = new Vector3(desiredPos.x, 0, desiredPos.y);
            transform.LookAt(lookPos);
        }
    }
예제 #2
0
        public void Shoot()
        {
            time += Time.deltaTime;
            if (fireCountDown <= 0)
            {
                gunController.Shoot();

                if (Too.GetData <bool>(Data.killedNumFireRate))
                {
                    fireCountDown = 1f / (fireRate + (killData.kill * 5));
                }
                else
                {
                    fireCountDown = 1f / fireRate;
                }
            }
        }
예제 #3
0
        void Update()
        {
            if (target != null && ai != null)
            {
                ai.destination = target;
            }

            if (GameController.State == GameState.Playing && !downing)
            {
                Shoot();

                fireCountDown -= Time.deltaTime;

                if (transform.position.y < 0.45f)
                {
                    downing = true;
                    GetComponent <BoxCollider>().material = gameController.SlideMat;
                    rb.mass = 20f;
                    CrownControl();
                }
                else if (transform.position.y < -2f)
                {
                    transform.parent = null;
                }

                if (downing && killingMeObjects.Count > 0)
                {
                    Kill();
                }

                if (killData.name == name && killData.kill > currentKill && Too.GetData <bool>(Data.killScale))
                {
                    Scale();
                }
            }

            if (transform.position.y < -9f)
            {
                Destroy(gameObject);
            }
        }