Ejemplo n.º 1
0
    /* ==========================================================================================================
     * UNITY METHODS
     * ==========================================================================================================
     */

    void Awake()
    {
        //
        dictColorsToEnglish = new Dictionary <Color, string>();
        dictColorsToEnglish.Add(Color.black, "black");
        dictColorsToEnglish.Add(Color.blue, "blue");
        dictColorsToEnglish.Add(Color.cyan, "cyan");
        dictColorsToEnglish.Add(Color.green, "green");
        dictColorsToEnglish.Add(Color.yellow, "yellow");
        dictColorsToEnglish.Add(Color.red, "red");
        dictColorsToEnglish.Add(Color.magenta, "magenta");
        dictColorsToEnglish.Add(Color.grey, "grey");
        dictColorsToEnglish.Add(Color.white, "white");


        // Get the main camera
        if (trMainCamera == null)
        {
            trMainCamera = Camera.main.transform;
        }

        if (trObjectivesCard == null)
        {
            trObjectivesCard = GameObject.Find("ObjectivesCard").transform;
        }

        // Get the DOF script
        dofScript         = trMainCamera.gameObject.GetComponent <DepthOfFieldScatter>();
        dofScript.enabled = false;

        // Find the level manager object and script
        GameObject goLevelManager = GameObject.Find("Level Manager");

        if (goLevelManager)
        {
            levelManagerScript = goLevelManager.GetComponent <LevelManager>();
        }

        // Register myself with the level manager. Why? Well, I'm the only player script for now...
        levelManagerScript.RegisterObjectiveCard(this.transform, this);

        guiObjectivesCardScript = gameObject.GetComponent <GUIObjectivesCard>();
    }
Ejemplo n.º 2
0
 /// <summary>
 /// The objective card will register itself with us. That will be useful to when the level ends and we
 /// must force the card to be shown
 /// </summary>
 public void RegisterGUIObjectivesCard(GUIObjectivesCard cardScript)
 {
     guiObjectivesCardScript = cardScript;
 }