Exemple #1
0
    void CheckMotion()
    {
        print("CheckMotion " + this.GetInstanceID());
        print("CheckMotion " + this.GetInstanceID());

        if (this.positionOnCheckMotion == Vector2.zero)
        {
            print("CheckMotion NEW " + this.GetInstanceID());
            print("CheckMotion NEW " + this.GetInstanceID());
            this.positionOnCheckMotion = this.GetComponent <RectTransform>().localPosition;
        }
        else
        {
            print(this.positionOnCheckMotion);
            print(this.GetComponent <RectTransform>().localPosition);
            //if (this.positionOnCheckMotion.Equals(this.GetComponent<RectTransform>().localPosition))
            if (Vector3Util.AreVectorEqual(this.positionOnCheckMotion, this.GetComponent <RectTransform>().localPosition, 1))
            {
                print("CheckMotion Cancel " + this.GetInstanceID());
                CancelInvoke();
                this.enablePhysics = false;
            }
            else
            {
                this.positionOnCheckMotion = this.GetComponent <RectTransform>().localPosition;
                print("CheckMotion Continue " + this.GetInstanceID());
            }
        }
    }