Exemple #1
0
    // Use this for initialization
    void Start()
    {
        // Set the screen size
        GetComponent <CanvasScaler>().referenceResolution = ScreenData.GetScreenSize();

        // Initialize Components
        graphicRaycaster = GetComponent <GraphicRaycaster>();

        int creation = SaveClass.GetPlayerPrefInt(SaveClass.Save_Keys.Key_Level_Editor_Creation);

        if (creation == 1)
        {
            RefTileMap.CreateNew(SaveClass.GetPlayerPrefInt(SaveClass.Save_Keys.Key_Level_Editor_Row), SaveClass.GetPlayerPrefInt(SaveClass.Save_Keys.Key_Level_Editor_Col));
        }
        else if (creation == 0)
        {
            RefTileMap.Load(SaveClass.GetPlayerPrefString(SaveClass.Save_Keys.Key_Level));

            // Assign current values to editor UI
            MapName.text = RefTileMap.Name;
            var parameters = RefTileMap.ObjectiveParams.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            RefObjectiveParam.text = parameters[0];
        }
        else
        {
            Application.LoadLevel("MainMenuScene");
        }
    }
Exemple #2
0
    private void updateBounds()
    {
        // Top
        Vector3 pos   = Bounds[(int)BOUNDS_TYPE.BOUNDS_TOP].transform.position;
        Vector3 scale = Bounds[(int)BOUNDS_TYPE.BOUNDS_TOP].transform.localScale;

        pos.y   = TopBound;
        scale.x = ScreenData.GetScreenSize().x;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_TOP].transform.position   = pos;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_TOP].transform.localScale = scale;

        // Bottom
        pos     = Bounds[(int)BOUNDS_TYPE.BOUNDS_BOTTOM].transform.position;
        scale   = Bounds[(int)BOUNDS_TYPE.BOUNDS_BOTTOM].transform.localScale;
        pos.y   = BottomBound;
        scale.x = ScreenData.GetScreenSize().x;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_BOTTOM].transform.position   = pos;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_BOTTOM].transform.localScale = scale;

        // Left
        pos     = Bounds[(int)BOUNDS_TYPE.BOUNDS_LEFT].transform.position;
        scale   = Bounds[(int)BOUNDS_TYPE.BOUNDS_LEFT].transform.localScale;
        pos.x   = LeftBound;
        scale.y = ScreenData.GetScreenSize().y;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_LEFT].transform.position   = pos;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_LEFT].transform.localScale = scale;

        // Right
        pos     = Bounds[(int)BOUNDS_TYPE.BOUNDS_RIGHT].transform.position;
        scale   = Bounds[(int)BOUNDS_TYPE.BOUNDS_RIGHT].transform.localScale;
        pos.x   = RightBound;
        scale.y = ScreenData.GetScreenSize().y;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_RIGHT].transform.position   = pos;
        Bounds[(int)BOUNDS_TYPE.BOUNDS_RIGHT].transform.localScale = scale;
    }
Exemple #3
0
    // Use this for initialization
    protected override void Start()
    {
        TotalSize = ScreenData.GetScreenSize();
        tileSize  = calculateTileSize(TotalSize);
        base.Start();

        // Initialize Components
        waypointManager = GetComponent <WaypointManager>();
    }
Exemple #4
0
    // Use this for initialization
    protected override void Start()
    {
        TotalSize = ScreenData.GetScreenSize();
        tileSize  = calculateTileSize(TotalSize);

        // Set up the player List
        playerList = new List <GameObject> {
            RefPlayer1, RefPlayer2
        };

        base.Start();
    }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     GetComponent <CanvasScaler>().referenceResolution = ScreenData.GetScreenSize();
     updateSideBar();
     resizeUI();
 }