Пример #1
0
    // Use this for initialization
    void Start()
    {
        // THE MASTER /////////////////////
        // designed as a easy user input for designer
        master   = FindObjectOfType <MASTER> ();
        Observer = FindObjectOfType <OBSERVER> ();
        ////////////////////////////////////
        worldSizeX = master.worldSizeX;
        worldSizeZ = master.worldSizeZ;
        worldSizeY = master.worldSizeY;

        gameManager = FindObjectOfType <GameManager> ();

        GridLocToWorldLocLookup = new Hashtable();
        GridLocToGridObjLookup  = new Hashtable();

        pathfindingCubeList = new Hashtable();

        // SPAWN //
        spawn = Instantiate(spawnPrefab, transform, false);
        ////////////////
    }
Пример #2
0
    //private GUIController guiController;
    //private TestPlayerScript testPlayerScript;

    //public bool layMaps;

    //public bool activateGrid;
    //public bool deactivateGrid;

    //public List<GameObject[,]> WorldGrid_CubeRef_LayersList;

    //public bool GAMESTART = false;

    // Use this for initialization
    void Start()
    {
        // THE MASTER /////////////////////
        // designed as a easy user input for designer
        master   = FindObjectOfType <MASTER> ();
        observer = FindObjectOfType <OBSERVER> ();
        ////////////////////////////////////
        worldSizeX = master.worldSizeX;
        worldSizeZ = master.worldSizeZ;
        worldSizeY = master.worldSizeY;

        totalCubesInX = worldSizeX * numCubesInX;
        totalCubesInZ = worldSizeZ * numCubesInZ;
        totalCubesInY = worldSizeY * numCubesInY;


        gridManager = FindObjectOfType <GridManager> ();
        //mapManager = FindObjectOfType<MapManager> ();
        cubeManager = FindObjectOfType <CubeManager> ();
        //guiController = FindObjectOfType<GUIController> ();
        //testPlayerScript = FindObjectOfType<TestPlayerScript> ();

        //WorldGrid_CubeRef_LayersList = new List<GameObject[,]>();

        ////////////////////////////

//		if (activateGrid) {
//			layMaps = false;
//			activateGrid = true;
//			GAMEMASTER_GridStart ();
//		} else if (layMaps) {
//			layMaps = true;
//			activateGrid = false;
//			GAMEMASTER_MapStart ();
//		}

        GAMEMASTER_GridStart();
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        rend   = transform.GetComponentInChildren <Renderer> ();
        sensor = transform.Find("Sensor").gameObject;

        playerStats = new Dictionary <string, int> {
            { "M", 4 }, { "WS", 4 }, { "BS", 4 }, { "S", 4 }, { "T", 4 }, { "W", 4 }, { "I", 4 }, { "A", 4 }, { "LD", 4 }, { "C", 1 }, { "F", 0 }
        };

        //transform.position = Vector3.zero;
        //transform.position = currentStandingCube.transform.position;

        Observer = FindObjectOfType <OBSERVER> ();

//		gameManagerScript = FindObjectOfType<GameManager> ();
//		mapManagerScript = FindObjectOfType<MapManager> ();
        gridManager = FindObjectOfType <GridManager> ();
//		cameraManagerScript = FindObjectOfType<CameraManager> ();
//		pathFindingScript = FindObjectOfType<PathFinding> ();

        //mapsPlacedRef = new List<GameObject> ();
        //pathfindingCubeList = new List<GameObject> ();

        SetManagerCameras();

        leftArmAnimator  = leftArmJoint.transform.GetComponent <Animator>();
        rightArmAnimator = RightArmJoint.transform.GetComponent <Animator>();
        leftLegAnimator  = leftLegJoint.transform.GetComponent <Animator>();
        rightLegAnimator = RightLegJoint.transform.GetComponent <Animator>();

        Quaternion target = Quaternion.Euler(0, 0, playerRotation);

        this.transform.rotation = target;

        //Invoke ("ForcePlayerMoveAtStart", 1.0f);
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        Observer     = FindObjectOfType <OBSERVER> ();
        playerScript = FindObjectOfType <TestPlayerScript> ();

        panelPieces[0] = panelGround;
        panelPieces[1] = panelLeft;
        panelPieces[2] = panelFront;
        panelPieces[3] = panelRight;
        panelPieces[4] = panelBack;
        panelPieces[5] = panelCeiling;
        // Angles
//		panelPieces[6] = panelGroundLeft;
//		panelPieces[7] = panelGroundFront;
//		panelPieces[8] = panelGroundRight;
//		panelPieces[9] = panelGroundBack;
//		panelPieces[10] = panelCeilingLeft;
//		panelPieces[11] = panelCeilingFront;
//		panelPieces[12] = panelCeilingRight;
//		panelPieces[13] = panelCeilingBack;
//
//		if (transform.Find ("CubeSelect")) {
//			cubeSelectTrans = transform.Find ("CubeSelect").gameObject;
//		}

        // this will need to change for the alien to walk up walls
        // and if marine is to climb up walls (ladders)
//		if (transform.Find ("Ground")) {
//			if (transform.Find ("Ground").gameObject.activeSelf) {
//				cubeWalkable = true;
//			} else {
//				cubeWalkable = false;
//			}
//		}
        ////////////////////////////////////////////////
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        // THE MASTER /////////////////////
        // designed as a easy user input for designer
        master   = FindObjectOfType <MASTER> ();
        Observer = FindObjectOfType <OBSERVER> ();
        ////////////////////////////////////
        worldSizeX = master.worldSizeX;
        worldSizeZ = master.worldSizeZ;
        worldSizeY = master.worldSizeY;

        gameManager = FindObjectOfType <GameManager> ();
        gridManager = FindObjectOfType <GridManager> ();

        GridLocToCubeObjLookup = new Hashtable();

        //		case 0: Empty
        //		case 1: Floor
        //		case 2: Left
        //		case 3: Front
        //		case 4: Right
        //		case 5: Back
        //		case 6: Ceiling
        //		case 7: Floor Left Back
        //		case 8: Floor Left
        //		case 9: Floor Left Front
        //		case 10: Floor front
        //		case 11: Floor Front Right
        //		case 12: Floor Right
        //		case 13: Floor Right Back
        //		case 14: Floor Back
        //		case 15: Left Back
        //		case 16: Left Front
        //		case 17: Front Right
        //		case 18: Right Back


        // LOOK AT THESE AS UNDERNEATH MAPS
        // First Floor
        floors.Add(new int[, ] {
//			{ 07, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 12, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 12, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 12, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 12, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12},
//			{ 09, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11}
            { 07, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 08, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 12 },
            { 09, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11 }
        });
        // second Floor
        floors.Add(new int[, ] {
//			{ 15, 05, 05, 05, 05, 05, 05, 05, 05, 05, 05, 18},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 04, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 04, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 04, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 04, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04},
//			{ 16, 03, 03, 03, 03, 03, 03, 03, 03, 03, 03, 17},
            { 15, 05, 05, 05, 05, 05, 05, 05, 05, 05, 05, 18 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 16, 03, 03, 03, 03, 03, 03, 03, 03, 03, 03, 17 },
        });
        // third Floor
        floors.Add(new int[, ] {
            { 15, 05, 05, 05, 05, 05, 05, 05, 05, 05, 05, 18 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 02, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 04 },
            { 16, 03, 03, 03, 03, 03, 03, 03, 03, 03, 03, 17 },
        });
    }