Esempio n. 1
0
    private void Awake()
    {
        gameController = GameObject.Find(Misc.Constants.GAME_CONTROLLER_NAME).GetComponent <Core.GameController>();
        gObj           = gameObject;
        circle         = gObj.transform.Find("Sphere").gameObject;
        rbCircle       = circle.GetComponent <Rigidbody2D>();
        circle.SetActive(false);
        pathEndMark = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        pathEndMark.transform.parent     = transform;
        pathEndMark.transform.localScale = new Vector3(0.5f, 0.5f, 1f);

        pointAccuracy     = 0.1f;
        amountOfPoints    = 1000;
        mousePositionList = new List <Vector3>();

        lineRenderer = gObj.AddComponent <LineRenderer>();
        lineRenderer.positionCount = 0;
        lineRenderer.material      = new Material(Shader.Find("Sprites/Default"));
        lineRenderer.startWidth    = 0.1f;
        lineRenderer.endWidth      = 0.1f;
        lineRenderer.useWorldSpace = true;
        lineRenderer.loop          = false;
        lineRenderer.sortingOrder  = 10;

        createPath   = false;
        drawPath     = false;
        spacePressed = false;
    }