private void Start()
    {
        Cursor.visible = false;
        rb2D           = gameObject.GetComponent <Rigidbody2D>();
        grappleRB2D    = grapple.GetComponent <Rigidbody2D>();
        MouseInitPos();
        GS  = GameObject.Find("GameManager").GetComponent <GameState>();
        IMC = GameObject.Find("GameManager").GetComponent <InvertMatCol>();

        for (int i = 0; i < this.transform.childCount - 1; i++)
        {
            if (IMC.dark == true)
            {
                transform.GetChild(i).GetComponent <SpriteRenderer>().color = IMC.objDark;
            }

            if (IMC.dark == false)
            {
                transform.GetChild(i).GetComponent <SpriteRenderer>().color = IMC.objLight;
            }
        }
    }
    private void Start()
    {
        wallHeight      = level.transform.GetChild(0).localScale.y + 1;
        nextLevelHeight = wallHeight * currentLevel;
        IMC             = GameObject.Find("GameManager").GetComponent <InvertMatCol>();

        if (IMC.dark == true)
        {
            for (int i = 0; i < GameObject.Find("Level (0)").transform.childCount; i++)
            {
                GameObject.Find("Level (0)").transform.GetChild(i).GetComponent <SpriteRenderer>().color = IMC.envDark;
            }
            Camera.main.backgroundColor = IMC.bgDark;
        }
        else if (IMC.dark == false)
        {
            for (int i = 0; i < GameObject.Find("Level (0)").transform.childCount; i++)
            {
                GameObject.Find("Level (0)").transform.GetChild(i).GetComponent <SpriteRenderer>().color = IMC.envLight;
            }
            Camera.main.backgroundColor = IMC.bgLight;
        }
    }
 // Use this for initialization
 void Start()
 {
     IMC = GameObject.Find("GameManager").GetComponent <InvertMatCol>();
     this.gameObject.GetComponent <Button>().onClick.AddListener(delegate { IMC.InvertMenu(); IMC.Invert(); });
 }
Exemple #4
0
    /*---------------------------MenueFunctions------------------------------*/

    void Start()
    {
        GS  = GameObject.Find("GameManager").GetComponent <GameState>();
        IMC = GameObject.Find("GameManager").GetComponent <InvertMatCol>();
    }