Mobile.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    public override void Update()
    {
        base.Update();
        feet_check = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y - .5f), checkWall.direction, checkWallDist, checkMasks);
        Debug.DrawRay(new Vector2(transform.position.x, transform.position.y - .5f), checkWall.direction,Color.blue);
        if (feet_check.collider != null)
        {
            check_empty = Physics2D.Raycast(checkWall.origin, checkWall.direction, checkWallDist, checkMasks);
            Debug.DrawRay(checkWall.origin, checkWall.direction, Color.yellow);
            if (check_empty.collider == null && !dying)
            {
                //RaycastHit2D newLoc = Physics2D.Raycast(
                transform.position = new Vector3(transform.position.x, transform.position.y + .3f);
            }
        }
    }

Usage Example

Example #1
0
        public AnimatedItemEffect(int Source, int xSource, int ySource, int zSource, int ItemID, IHue Hue, int duration)
            : this(ItemID, Hue, duration)
        {
            Mobile mobile = World.FindMobile(Source);

            if (mobile != null)
            {
                this.SetSource(mobile);
                if (mobile.Player || mobile.IsMoving || xSource == 0 && ySource == 0 && zSource == 0)
                {
                    return;
                }
                mobile.SetLocation(xSource, ySource, zSource);
                mobile.Update();
                mobile.UpdateReal();
            }
            else
            {
                Item Source1 = World.FindItem(Source);
                if (Source1 != null)
                {
                    this.SetSource(Source1);
                    if (xSource == 0 && ySource == 0 && zSource == 0)
                    {
                        return;
                    }
                    Source1.SetLocation(xSource, ySource, zSource);
                    Source1.Update();
                }
                else
                {
                    this.SetSource(xSource, ySource, zSource);
                }
            }
        }
All Usage Examples Of Mobile::Update