Exemple #1
0
    void Awake()
    {
        // Time button
        cameraGrey             = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraGrey>();                         // shader
        stoppableObjectManager = GameObject.FindGameObjectWithTag("StoppableObjectManager").GetComponent <StoppableObjectManager>(); // manager
        timeGUI = Resources.FindObjectsOfTypeAll <TimeGUI>()[0] as TimeGUI;

        // Animation
        spriteRenderer = GetComponent <SpriteRenderer>(); // Sprite flip X
        rb             = GetComponent <Rigidbody2D>();    // physics
        animator       = GetComponent <Animator>();       // Animator

        // Item collection
        bag = GetComponent <Bag>();

        // Bonus room
        movableCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MovableCamera>();
        countDown     = Resources.FindObjectsOfTypeAll <CountDown>()[0] as CountDown;

        // Falling
        gravity       = Physics.gravity.y;              // fall force
        boxCollider2D = GetComponent <BoxCollider2D>(); // raycast width
        sceneHeight   = GameObject.FindGameObjectWithTag("OuterBorder").GetComponent <OuterBorder>().BorderHeight();

        // Sound play
        // soundManager = GameObject.FindGameObjectWithTag("SoundManager").GetComponent<SoundManager>();
        soundManager = GetComponent <SoundManager>();
    }
Exemple #2
0
 void Awake()
 {
     cameraGrey = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraGrey>(); // shader
 }