using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TutorialLevel1Manager : LevelManager
{
    // Start is called before the first frame update
    Vector3 orig;
    public GameObject target1;
    public GameObject target2;
    public GameObject target3;

    public string[] ExplanationText2 = { "aa", "bb" };

    protected override void Start()
    {
        base.Start();
    }

    protected override void Update()
    {
        base.Update();


    }

    protected override bool WinCondition()
    {
        if(XZLengthSquare(player.transform.position,target1.transform.position) < 0.1)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    protected bool Condition1()
    {
        if (XZLengthSquare(player.transform.position, target1.transform.position) < 0.1)
        {
            DoubleClickMove = false;
            WASDMove = true;


            uiManager.WASDMove = WASDMove;
            //uiManager.PathCreateAble = PathRenderMove;
            uiManager.DoubleCLickMove = DoubleClickMove;

            uiManager.alert.Alert(ExplanationText2);
            return true;
        }
        else
        {
            return false;
        }
    }

    protected bool Condition2()
    {
        return true;
    }

    float XZLengthSquare(Vector3 a, Vector3 b)
    {
        return (a.x - b.x) * (a.x - b.x) + (a.z - b.z) * (a.z - b.z);
    }
}
