示例#1
0
    bool IsOutOfBounds()
    {
        SetupBounds sb = SetupBounds.instance;

        if (transform.position.x > sb.worldMax.x ||
            transform.position.y > sb.worldMax.y ||
            transform.position.x < sb.worldMin.x ||
            transform.position.y < sb.worldMin.y)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
示例#2
0
	void Awake () 
	{
		transform = GetComponent<Transform>();
		col = GetComponent<Collider2D>();
		sb = SetupBounds.instance;
	}
示例#3
0
 void Awake()
 {
     transform = GetComponent <Transform>();
     col       = GetComponent <Collider2D>();
     sb        = SetupBounds.instance;
 }