示例#1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         GameManager.i().lastCheckpoint = gameObject;
         facingDirection = GameManager.i().playerWolf.getFacingDirection();
     }
 }
示例#2
0
 void Start()
 {
     moveTimer       = 0;
     offsetDirection = Wolf.FacingDir.UP_RIGHT;
     initialOffset   = offsetUpRight;
     currentOffset   = offsetUpRight;
     finalOffset     = offsetUpRight;
 }
示例#3
0
    /**
     * Checks to see if this turn trigger lets objects turn to face the intended direction.
     * Returns true if this turn trigger will allow the object to face the intended direction.
     */
    public bool allowsDirection(Wolf.FacingDir direction)
    {
        switch (direction)
        {
        case Wolf.FacingDir.UP_RIGHT:   return(allowUpRight);

        case Wolf.FacingDir.UP_LEFT:    return(allowUpLeft);

        case Wolf.FacingDir.DOWN_RIGHT: return(allowDownRight);

        case Wolf.FacingDir.DOWN_LEFT:  return(allowDownLeft);

        default:
            Debug.LogWarning("Unknown direction in Turn.allowsDirection: " + direction + ".");
            return(false);
        }
    }
示例#4
0
    /**
     * Changes the camera's offset from the target so that the camera shows area
     * forward of the direction being faced.
     * @param Wolf.FacingDir Direction camera should reference to offset from
     * the camera.
     */
    public void SetOrientation(Wolf.FacingDir newDirection)
    {
        if (offsetDirection == newDirection)
        {
            return;
        }

        moveTimer       = changePositionDuration;
        initialOffset   = currentOffset;
        offsetDirection = newDirection;

        switch (offsetDirection)
        {
        case Wolf.FacingDir.UP_RIGHT:   finalOffset = offsetUpRight; break;

        case Wolf.FacingDir.UP_LEFT:    finalOffset = offsetUpLeft; break;

        case Wolf.FacingDir.DOWN_RIGHT: finalOffset = offsetDownRight; break;

        case Wolf.FacingDir.DOWN_LEFT:  finalOffset = offsetDownLeft; break;
        }
    }