예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     gam      = FindObjectOfType <GlobalAudioManager>();
     gm       = FindObjectOfType <GameManager>();
     cc2d     = FindObjectOfType <CharacterController2D>();
     invCount = FindObjectOfType <InventoryCountDefiner>();
 }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        startingCoordinates = player.transform.position;
        player.GetComponent <Rigidbody2D>().gravityScale = currentLevelStartingGravity;

        if (currentLevelStartingGravity < 0)
        {
            player.transform.eulerAngles = new Vector3(0, 180f, 180f);
        }
        else if (currentLevelStartingGravity > 0)
        {
            player.transform.eulerAngles = new Vector3(0, 0, 0);
        }

        platformIDNumber = 0;
        canvas.SetActive(true);
        prepPhase = true;
        prepPhaseButton.SetActive(false);
        startButton.SetActive(true);

        //Inventory Count Texts Referencing and Printing their texts at start
        invCount = FindObjectOfType <InventoryCountDefiner>();
        rotatingPlatformCountText = invCount.rotatingText;
        gravityPlatformCountText  = invCount.gravityText;
        jumpPlatformCountText     = invCount.jumpPlatText;
        rotatingPlatformCountText.GetComponent <Text>().text = rotatingPlatformCount.ToString();
        gravityPlatformCountText.GetComponent <Text>().text  = gravityPlatformCount.ToString();
        jumpPlatformCountText.GetComponent <Text>().text     = jumpPlatformCount.ToString();


        //Setting the Get Key GameObject to the Goal Script
        goal            = FindObjectOfType <Goal>();
        goal.getKeyText = invCount.getKeyText;
        goal.getKeyText.GetComponent <Image>().enabled = false;
    }