Пример #1
0
    public void Setup()
    {
        SETUP = MainTitleUI.getSetup();
        PLAYERDATA = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
        PLAYERDATA.Launch();
        ThumbGO = new GameObject("Thumbnails");
        ThumbGO.transform.parent = gameObject.transform;
        ThumbGO.transform.localPosition = new Vector3(0f,0f,0f);
        levelName = FETool.findWithinChildren(gameObject, "LevelTitle/LEVEL_NAME").GetComponent<TextUI>();
        _btnLeft = FETool.findWithinChildren(gameObject, "SelectLeft").GetComponent<LevelChooserButton>();
        _btnRight = FETool.findWithinChildren(gameObject, "SelectRight").GetComponent<LevelChooserButton>();

        Thumbs.Clear();
        foreach (LevelInfo _lvl in PLAYERDATA.PROFILE.ActivatedLevels)
        {
            LevelThumbnail _th = CreateThumbnail(_lvl);
            Thumbs.Add(_th);
        }
        for (int j = 0; j < Thumbs.Count ; j++)
        {
        //			Thumbs[j].gameObject.transform.localPosition = new Vector3(0f,0f,0f);
            Thumbs[j].gameObject.transform.localPosition = new Vector3(j * gapThumbs.x, 0f, gapThumbs.z);
        }

        Thumbs[0].isStartSlot = true;
        Thumbs[Thumbs.Count-1].isEndSlot = true;

        _btnLeft.Setup(this, LevelChooserButton.DirectionList.Left);
        _btnRight.Setup(this, LevelChooserButton.DirectionList.Right);
        currThumb = Thumbs[0];
        levelName.text = currThumb.nameLv.ToString();
        checkCurrThumb();
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        base.Setup();

        if (GameObject.FindGameObjectWithTag("PlayerData") == null)
        {
            GameObject _dataplayer = Instantiate(Resources.Load("Presets/PlayerData")) as GameObject;
            _profile = _dataplayer.GetComponent<PlayerData>();
            _profile.Launch();
        }
        else
        {
            _profile = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
            _profile.Launch();
        }

        BuyBtn = FETool.findWithinChildren(gameObject, "Buy").GetComponent<MiscButton>();
        FeedBtn = FETool.findWithinChildren(gameObject, "Feedback").GetComponent<MiscButton>();
        ReturnBtn = FETool.findWithinChildren(gameObject, "ReturnHome").GetComponent<MiscButton>();
        EndAlpha = FETool.findWithinChildren(gameObject, "END_ALPHA").GetComponent<TextUI>();
        EndDemo = FETool.findWithinChildren(gameObject, "END_DEMO").GetComponent<TextUI>();

        if (_profile.SETUP.GameType == GameSetup.versionType.Alpha)
        {
            EndDemo.color = Color.clear;
        }
        if (_profile.SETUP.GameType == GameSetup.versionType.Demo)
        {
            EndAlpha.color = Color.clear;

        }
        SubMenu _sub = GetComponent<SubMenu>();
        _sub.SetupSub(this);
        _sub.setupBtn();
        currentActiveMenu = _sub;
        currFocusedbtn = _sub.menuButtons[0];
        _sub.menuButtons[0].giveFocus(true);
        InvokeRepeating("checkPadMenu", 0f, 0.5f);

        TranslateAllInScene();
    }
Пример #3
0
    // Use this for initialization
    public void Awake()
    {
        if (GameObject.Find("Frameworks") == null)
        {
            GameObject fmObj = Instantiate(Resources.Load("Presets/Frameworks")) as GameObject;
            fmObj.name = "Frameworks";
        }

        if (GameObject.FindGameObjectWithTag("PlayerData") == null)
        {
            GameObject _dataplayer = Instantiate(Resources.Load("Presets/PlayerData")) as GameObject;
            _profile = _dataplayer.GetComponent<PlayerData>();
            _profile.Launch();
        }
        else
        {
            _profile = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
            _profile.Launch();
        }

        if (_profile.SETUP.GameType == GameSetup.versionType.Demo)
        {
        //			Screen.SetResolution(800,600, false);
        //			GameObject.Find("Frameworks/OT/View").GetComponent<OTView>().pixelPerfectResolution = new Vector2(800f,600f);
        //			GameObject.Find("Frameworks/OT/View").GetComponent<OTView>().alwaysPixelPerfect = true;
        //			GameObject.Find("Frameworks/OT/View").GetComponent<OTView>().customSize = 4;
        }

        GAMESTATE = _EditorState;
        _player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        GlobTuning = Instantiate(Resources.Load("Tuning/Global")) as LPTuning;
        InputMan = Instantiate(Resources.Load("Tuning/InputManager")) as InputManager;
        CurrentLevelInfo = Instantiate(Resources.Load("Tuning/Levels/" + NAME)) as LevelInfo;

        LocalTuning = Instantiate(Resources.Load("Maps/" + NAME + "/Setup")) as LevelParameters;
        LocalTuning.initScript();

        GameObject OutSpw = new GameObject("OuterSpawn");
        OuterSpawn = OutSpw;
        OuterSpawn.transform.parent = FETool.findWithinChildren(this.gameObject, "Enviro").transform;
        OuterSpawn.transform.position = new Vector3(0f, -7.5f, 0f);

        tools = gameObject.AddComponent<LevelTools>();
        tools._levMan = this;
        TranslateAllInScene();

        CollectiblePlaces[] collecPla = FETool.findWithinChildren(this.gameObject, "Enviro/CollectiblePlaces").GetComponentsInChildren<CollectiblePlaces>();
        foreach (CollectiblePlaces cpl in collecPla)
        {
            collecPlaces.Add(cpl);
        }
        Gate = GameObject.FindGameObjectWithTag("SpaceGate").GetComponent<SpaceGate>();
        Gate.Setup(this);

        wpDirector = GetComponentInChildren<WaypointDirector>();
        wpDirector.Setup(this);

        bricksMan = FETool.findWithinChildren(this.gameObject, "LevelBricks/Bricks").GetComponent<BricksManager>();
        bricksMan.Setup();

        if (GAMETYPE != LocalTuning.levelType)
        {
            Debug.Log("Type of LevelMana & Setup scrip arent't the same");
        }
        GAMETYPE = LocalTuning.levelType;
        switch (GAMETYPE)
        {
        case LevelParameters.levelTypeList.Debuggin :
        {
            linearTrigger = gameObject.AddComponent<LinearStepTrigger>();
            linearTrigger.Setup(this);
            break;
        }
        case LevelParameters.levelTypeList.Linear :
        {
            linearTrigger = gameObject.AddComponent<LinearStepTrigger>();
            linearTrigger.Setup(this);
            break;
        }
        case LevelParameters.levelTypeList.Maze :
        {
            break;
        }
        case LevelParameters.levelTypeList.Procedural :
        {
            GameObject gameo = FETool.createGameObject("ProceduralManager", gameObject);
            ProcMana = gameo.AddComponent<Procedural>();
            ProcMana.Setup(this);
            break;
        }
        case LevelParameters.levelTypeList.Vertical :
        {
            GameObject vm = new GameObject("VerticalManager");
            VerticalManager = vm.AddComponent<VerticalScroller>();
            vm.transform.parent = this.transform;
            VerticalManager.Setup(this);
            break;
        }
        }

        wpDirector.affectRelatedBricks(bricksMan.BricksList);

        if (LocalTuning.levelType != LevelParameters.levelTypeList.Debuggin)
        {
            if (GameObject.Find("UI") == null)
            {
                GameObject uiman = Instantiate(Resources.Load("Presets/UI")) as GameObject;
                uiman.name = "UI";
                menuManager = uiman.GetComponent<MainMenu>();
            }
            else
            {
                menuManager = GameObject.Find("UI").GetComponent<MainMenu>();
            }
        }
        if (menuManager != null)
        {
            menuManager.Setup(this);
        }
        managerChecker();
        //		proc.triggerStep(proc._listSteps[0]);
        _player.Setup();
        Setup();
    }