Example #1
0
    void Start()
    {
        /// References!
        var main = GameObject.Find("Main");

        this.lm = main.GetComponent <LevelManager>();
        var rb = main.GetComponent <ReferenceBuffer>();

        this.ms = main.GetComponent <TargetManagerBehaviour>();
        var gl = new GenerateLevel(this.ms, rb);
        ///

        /// Problem Text and Code!
        var infoText = rb.InfoTextObject;

        infoText.GetComponent <Text>().text = ProblemDesctiptions.level3;
        rb.ShowCode.SetText(InitialCodes.Level3);
        ///...

        /// Value Initialization
        this.gatheredTheSphere = false;
        this.placedTHeSphere   = false;
        ///...

        /// Base
        GameObject baseCylinder = gl.CylinderBasePrefab(new Vector3(30, 1, 30), true);

        ///...

        /// Player and cam!
        this.player     = gl.Player(this.initialPlayerPosition, true, true, true);
        this.mainCamera = GameObject.Find("MainCamera");
        CamHandling camHandling = this.mainCamera.GetComponent <CamHandling>();

        camHandling.target = this.player.transform;
        ///...

        /// Enitites!
        this.target = gl.GenerateEntity(
            EntityType.Target,
            new Vector3(7, 0, 0),
            PrimitiveType.Sphere,
            Color.white,
            null, "Level3Actor123");

        this.toTransport = gl.GenerateEntity(
            EntityType.NonTarget,
            new Vector3(-7, 0, 0),
            PrimitiveType.Sphere,
            Color.red,
            null, "Level3ToTranport567");

        this.destination = gl.GenerateEntity(
            EntityType.NonTarget,
            new Vector3(5, 0, 5),
            PrimitiveType.Cube,
            Color.gray,
            null, "Level3FinalPosition789");
        ///...
    }
Example #2
0
    private void Start()
    {
        var main   = GameObject.Find("Main");
        var ms     = main.GetComponent <TargetManagerBehaviour>();
        var gm     = main.GetComponent <GridManager>();
        var buffer = main.GetComponent <ReferenceBuffer>();
        var gl     = new GenerateLevel(ms, buffer, gm);
        var grid   = gl.GenerateGrid(10, 10);

        ///PLAYER
        this.player = gl.Player(new Vector3(20, 0, 10), true, true, true);
        var         mainCamera  = GameObject.Find("MainCamera");
        CamHandling camHandling = mainCamera.GetComponent <CamHandling>();

        camHandling.target = player.transform;

        var solvingSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        var tb            = solvingSphere.AddComponent <TargetBehaviour>();

        ms.registry.RegisterTarget(solvingSphere, TargetType.Test, GridTestMap.Level5TestName);
        solvingSphere.name = "Solving Sphere";
        solvingSphere.transform.position = new Vector3(0, 10, 0);
    }