예제 #1
0
    //Vector3 backgroundNewPos;
    //public GameObject backgroundPosition;

    // Use this for initialization
    void Start()
    {
        BoxMaker      = MainController.GetComponent <CreateBoxes>();
        OtherControls = MainController.GetComponent <OtherGameControls>();
        //levelSize = MainController.GetComponent<OtherGameControls>().LevelSize;

        PlatformOffset_y = Platform.position.y - Camera.position.y;
        SpawnOffset_y    = BoxMaker.spawnLocation.y - Camera.position.y;

        Platform.GetComponent <Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation | RigidbodyConstraints2D.FreezePositionY;


        // Set Block Spawning right outside camera view
        MainController.GetComponent <CreateBoxes>().spawnLocation.y = Camera.transform.position.y + 7.5f;

        SetLevel(currentLevel);
        transform.localPosition = CalcTriggerPosition();
        NonScrollablePositions();

        //timer = timeToCompleteLevel;

        // Hide scoreboard
        LevelScoreText.enabled = false;
        NumBlocksText.enabled  = false;
        StuckBonusText.enabled = false;
        ResumeButton.gameObject.SetActive(false);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        OtherControls = MainController.GetComponent <OtherGameControls>();
        UnivSource    = OtherControls.UnivAudioSource;

        StickID = OtherControls.StuckID;

        // RainStuck groups get stick-to priority
        if (transform.name == "RainStuck")
        {
            StickID *= -1;
        }
    }