Exemple #1
0
    void Update()
    {
        if (isRunning == false)
        {
            return;
        }

        if (Physics.Raycast(transform.position, transform.forward, out hit))
        {
            line.SetPosition(1, Vector3.Lerp(line.GetPosition(1), transform.InverseTransformPoint(hit.point), 0.5001f));
            pointable = hit.transform.GetComponent <IPointable>();
            if (Trigger)
            {
                pointable?.Click();
            }
        }
        else
        {
            line.SetPosition(1, Vector3.Lerp(line.GetPosition(1), Vector3.forward * 0.2f, 0.5001f));
            pointable = null;
        }

        if (pointable != prevPointable)
        {
            prevPointable?.UnPoint();
            pointable?.Point();
            prevPointable = pointable;
        }
    }
Exemple #2
0
        public _Pointer createPointer(string strkey, IPointable p, int arrowOffset = 1, int nameOffset = 1)
        {
            _Pointer po = new _Pointer(this, strkey, p, arrowOffset, nameOffset);

            Pointers.Add(po);
            return(po);
        }
Exemple #3
0
            public _Pointer(Robot r, string strname, IPointable p, int arrowOffset = 1, int nameOffset = 1)
            {
                this.r           = r;
                this.p           = p;
                this.strname     = strname;
                this.arrowOffset = arrowOffset;
                this.nameOffset  = nameOffset;

                arrow          = new Label();
                arrow.AutoSize = true;
                arrow.Text     = "è"; //Arrow character
                arrow.Font     = new Font("Wingdings", 10, FontStyle.Bold);
                r.positionOnTop(p.key, arrow, arrowOffset);

                name          = new Label();
                name.AutoSize = true;
                name.Text     = strname;
                name.Font     = new Font("Times New Roman", 10, FontStyle.Bold);
                r.positionOnTop(arrow, name, nameOffset);
                r.container.Invoke(new Action(delegate() //Invoke is used to access the UI thread from the sort thread
                {
                    r.container.Controls.Add(arrow);
                    r.container.Controls.Add(name);
                }));
            }
Exemple #4
0
 public void setIndex(IPointable p)
 {
     this.p = p;
     r.container.Invoke(new Action(delegate()
     {
         r.positionOnTop(p.key, arrow, arrowOffset);
         r.positionOnTop(arrow, name, nameOffset);
     }));
     r.suspend(r.delay);
 }
Exemple #5
0
 public MemoryStream getmem(IPointable data)
 {
     if (this.Contains(data))
         return new MemoryStream(base.GetBuffer(), data.Address - start_address, data.SizeOf);
     else return null;
 }
Exemple #6
0
 public bool Contains(IPointable calling_object)
 {
     return (calling_object.Address - start_address >= 0
         && calling_object.Address - start_address + calling_object.SizeOf <= Length);
 }
 protected virtual void Awake()
 {
     Pointable = _pointable as IPointable;
 }
 public void InjectPointable(IPointable pointable)
 {
     _pointable = pointable as MonoBehaviour;
     Pointable  = pointable;
 }
 public void InjectAllPointableDebugPolylineGizmos(IPointable pointable)
 {
     InjectPointable(pointable);
 }
Exemple #10
0
 public void InjectAllPointableUnityEventWrapper(IPointable pointable)
 {
     InjectPointable(pointable);
 }
 public void InjectAllPointableDebugVisual(IPointable pointable, Renderer renderer)
 {
     InjectPointable(pointable);
     InjectRenderer(renderer);
 }
Exemple #12
0
 public void AddScore(IPointable pointable)
 {
     score += pointable.Points;
 }