示例#1
0
 /// <summary>
 /// Move this instance.
 /// </summary>
 public void Move()
 {
     if (started)
     {
         Vector3 position = this.transform.position;
         position          += velocity;
         position           = wraper.Wrap(position);
         transform.position = position;
     }
 }
示例#2
0
    /// <summary>
    /// Move this instance.
    /// </summary>
    public void Move()
    {
        Vector3 position = this.transform.position;

        position += velocity;
        if (wraper != null)
        {
            position = wraper.Wrap(position);
        }
        this.transform.position = position;
    }
示例#3
0
 public static ITitled Wrap(ITitled node)
 {
     if (node != null)
     {
         var item = node as ItemType;
         if (item != null && item.PageType == PageType.Question)
         {
             return(ExaminationWrapper.Wrap(item));
         }
         return(Wraper <ITitled> .Wrap(node));
     }
     return(null);
 }
示例#4
0
    /// <summary>
    /// Move this instance.
    /// </summary>
    public void Move()
    {
        //get the position
        Vector3 position = transform.position;

        //calculate the change in position
        velocity += acceleration;
        velocity  = Vector3.ClampMagnitude(velocity, maxSpeed);
        position += velocity;
        //calculate the ships rotation
        Quaternion rotation = Helper.UnitToQuat(heading);

        //wrap the position
        position = wraper.Wrap(position);
        //set the ships position and rotation
        transform.SetPositionAndRotation(position, rotation);
        //decelerate
        velocity     *= rateDeceleration;
        acceleration *= rateDeceleration;
    }