Exemplo n.º 1
0
    public void OnEnd(Vector3 ScreenPosition)
    {
        if (CurrentComposer == null)
        {
            return;
        }

        CurrentComposer = null;
    }
Exemplo n.º 2
0
    public static LineComposer GetLine(string name, Vector3 position, float thickness, Material LineMaterial)
    {
        GameObject instance = new GameObject(name);

        instance.transform.position = position;

        LineComposer Composer = instance.AddComponent <LineComposer>();

        Composer.thickness = thickness;
        Composer.normal    = Vector3.back;

        Composer.AddPoint(new Vector3(0, 0, 0));
        Composer.SetMaterial(LineMaterial);

        return(Composer);
    }
Exemplo n.º 3
0
    public void OnMove(Vector3 ScreenPosition)
    {
        if (!drawer.levelDataModel.CanDraw(ScreenPosition))
        {
            return;
        } //TODO may remake

        Collider2D[] colls = Physics2D.OverlapCircleAll(Camera.main.ScreenToWorldPoint(ScreenPosition),
                                                        DrawLine.THICKNESS
                                                        );
        for (int i = 0; i < colls.Length; i++)
        {
            LineComposer line = colls[i].GetComponent <LineComposer>();
            if (line != null)
            {
                GameObject.Destroy(line.gameObject);
                break;
            }
        }
    }
Exemplo n.º 4
0
    public void OnStart(Vector3 ScreenPosition)
    {
        if (!drawer.levelDataModel.CanDraw(ScreenPosition))
        {
            return;
        } //TODO may remake

        Analytics.CustomEvent(
            Constants.IIinputEvent,
            new Dictionary <string, object>()
        {
            { "name", nameof(DrawSimpleLine) }
        }
            );

        Vector3 position = Camera.main.ScreenToWorldPoint(ScreenPosition);

        position.z      = 0;
        CurrentComposer = LineComposer.GetLine("line",
                                               position,
                                               DrawLine.THICKNESS,
                                               drawer.LineMaterial
                                               );
    }