Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (selectedCharacter == null)
        {
            return;
        }

        if (selectedCharacter.IsDead())
        {
            selectedCharacter = null;
        }

        //Right click deselect character
        if (Input.GetMouseButtonDown(1))
        {
            selectedCharacter = null;
        }

        if (!currentlySelectedChar && !currentlyTargetedChar && Input.GetMouseButtonDown(0))
        {
            selectedCharacter.Command_WalkTo(GetWorldClickPosition());
        }

        currentlySelectedChar = false;
        currentlyTargetedChar = false;
    }
Esempio n. 2
0
    private IEnumerator StartBattleScenario()
    {
        yield return(new WaitForSeconds(.1f));

        knight.Command_WalkTo(new Vector3(-4f, -2.5f, 0f));
        barbarian.Command_WalkTo(new Vector3(-6.5f, -1f, 0f));
        ninja.Command_WalkTo(new Vector3(-5f, -4f, 0f));

        yield return(new WaitForSeconds(3f));

        AI_Controller.Instance.SendWave_1();

        do
        {
            yield return(new WaitForSeconds(1f));
        } while (!AI_Controller.Instance.AreAllMinionsDead());

        yield return(new WaitForSeconds(3f));

        AI_Controller.Instance.SendWave_2();

        yield return(new WaitForSeconds(15f));

        AI_Controller.Instance.SendWave_3();

        do
        {
            yield return(new WaitForSeconds(1f));
        } while (!AI_Controller.Instance.AreAllMinionsDead());

        yield return(new WaitForSeconds(3f));

        AI_Controller.Instance.SendWave_4();

        do
        {
            yield return(new WaitForSeconds(1f));
        } while (!AI_Controller.Instance.AreAllMinionsDead());

        yield return(new WaitForSeconds(3f));

        AI_Controller.Instance.SendWave_5();
    }