示例#1
0
    // Use this for initialization
    void Start()
    {
        GameObject camera = GameObject.Find ("Camera");

        stageData = GameObject.FindObjectOfType<StageData> ();

        minX = -stageData.getStageWidth () / 2;
        maxX = minX + stageData.getStageWidth ();
        minY = -stageData.getStageHeight () / 2;
        maxY = minY + stageData.getStageHeight ();

        t = GetComponent<Transform>();
        origin = new Vector3 (t.position.x, t.position.y, t.position.z);
        staff = GameObject.Find ("staff").GetComponent<StaffBehavior> ();
    }
示例#2
0
    /*
     * This class handles player input, such as pressing the pause button to pause playback, pressing the reset button to reset the level, etc.
     * It is attached to the Camera prefab.
     */
    // Use this for initialization
    void Start()
    {
        sd = GameObject.FindObjectOfType<StageData> ();
        float stageWidth = sd.getStageWidth();
        float stageHeight = sd.getStageHeight();

        minX = (gameObject.GetComponent<Transform> () as Transform).position.x - (stageWidth / 2);
        minY = (gameObject.GetComponent<Transform> () as Transform).position.y - (stageHeight / 2);
        maxX = minX + stageWidth;
        maxY = minY + stageHeight;
    }