コード例 #1
0
 /// <summary>
 /// Method <c>Awake</c> called by engine as part of startup process. Used to
 /// initialize important values.
 /// </summary>
 public void Awake()
 {
     rb             = GetComponent <Rigidbody2D>();
     audioSrc       = GetComponent <AudioSource>();
     gameContScript = gameCont.GetComponent <MazeNewGameController>();
     flashTimer     = new LoopTimer(MakeVisible, SwitchVisibility, 0.6f, 0.1f);
     rend           = GetComponent <SpriteRenderer>();
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     iconScript = extraInfoIcon.GetComponent <IconTextScript>();
     iconScript.Setup(icon, iconText);
     mapCont              = mapContGO.GetComponent <MazeNewGameController>();
     group                = GetComponent <CanvasGroup>();
     group.alpha          = 0;
     group.blocksRaycasts = false;
     gameObject.SetActive(false);
 }
コード例 #3
0
    // Start is called before the first frame update
    public void Start()
    {
        //Calculate the camera dimensions for use by the map generator
        float   camHeight = Camera.main.orthographicSize;
        float   camWidth  = Camera.main.aspect * camHeight;
        Vector2 camSize   = new Vector2(camWidth, camHeight);

        //Initialize game controller and cell map
        gameController = gameContGO.GetComponent <MazeNewGameController>();
        Debug.Log("In MapController.Start - Creating cell map");
        cellMaze = new CellMap(camSize, gridSize, mapBorderSize);

        //Provide new custom cell lookup so that map behaves properly with maze
        //and has the proper textures
        cellMaze.UpdateCellCodeLookup(GetSpecializedLookup());
    }