void doClick(int cur, int stat)
    {
        if (cur == 0)
        {
            if (stat == 0)
            {
                Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                float   alpha    = Mathf.Atan2(mousePos.y - transform.position.y, mousePos.x - transform.position.x) * Mathf.Rad2Deg;
                FM._doAttack(alpha, 0, true);
            }
        }

        if (cur == 1)
        {
            if (stat == 0)
            {
                Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                //float dist = Vector2.Distance(transform.position, new Vector2(mousePos.x, mousePos.y));
                float alpha = Mathf.Atan2(mousePos.y - transform.position.y, mousePos.x - transform.position.x) * 180 / Mathf.PI;
                FM._doAttackCombo(alpha, 0, 10);
            }
        }

        if (cur == 2)
        {
            if (stat == 0)
            {
                FM._doShield();

                Debug.Log("suk");
            }
            else if (stat == 2)
            {
                FM._stopShield();
                Debug.Log("a");
            }
        }
    }
Esempio n. 2
0
    private void Update()
    {
        if (presentSituation == 0)
        {
            if (onStart)
            {
                Debug.Log("figna");
                BMM._stop();

                onStart = false;
            }
        }


        if (presentSituation == 2)
        {
            if (onStart)
            {
                BMM._changeTargetPosition(TargetPoint.transform.position);
                _initTarget();

                onStart = false;
            }

            BMM._botMoveManagerLoop(TargetPoint.transform.position);
        }
        else if (presentSituation == 3)
        {
            if (onStart)
            {
                FM._doAttack(Mathf.Atan2(Target.transform.position.y - transform.position.y, Target.transform.position.x - transform.position.x) * Mathf.Rad2Deg, situationType);

                onStart = false;
            }
        }
    }