Наследование: MonoBehaviour
Пример #1
0
	// 게임 시작 시에 한 번만 호출된다.
	public override void	start()
	{
		this.player = PartyControl.get().getLocalPlayer();

		this.camera_control = CameraControl.get();

		// ---------------------------------------------------------------- //

		this.control.GetComponent<Rigidbody>().isKinematic = true;
		this.control.GetComponent<Rigidbody>().Sleep();

		this.control.setVisible(false);

		this.hover.gravity     = Physics.gravity.y*0.1f;
		this.hover.accel_scale = 2.0f;

		this.hover.zero_level = 3.0f;
		this.hover.hard_limit.max = 100.0f;

		this.radius = 5.0f;

		//

		this.step.set_next(STEP.IDLE);
	}
 // Use this for initialization
 void Start()
 {
     if(!instance)
     {
         instance = this;
     }
 }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        cameraControl = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraControl>();

        this.guiTexture.enabled = false;
        simulationScript = GameObject.FindGameObjectWithTag("GameController").GetComponent<SimulationScript>();
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        controller = this.GetComponent<CameraControl>();

        destination = new Vector3 (-120, 0, 0);

        thoughtDestination = new Vector3 (-125, 0, 0);

        dialoguePos = new Vector3 (-122f, -3.7f, 0f);

        thoughtBubble.SetActive (false);
        RthoughtBubble.SetActive (false);
        smoke.SetActive (false);

        controller.followMale.GetComponent<SpriteRenderer>().enabled = false;
        controller.followFemale.GetComponent<SpriteRenderer>().enabled = false;

        Num1.SetActive (false);
        FemNum2.SetActive (false);
        MaleNum2.SetActive (false);
        Num3.SetActive (false);
        Num4.SetActive (false);
        Num5.SetActive (false);
        FemNum6.SetActive (false);
        MaleNum6.SetActive (false);
        Num7.SetActive (false);
        Num8.SetActive (false);

        check = true;
        done = false;
        tutorial.SetActive(false);
        dialogue = "Gigabyte1.0";

        playerEnabled = false;
    }
Пример #5
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     camCtrl = Camera.main.GetComponent<CameraControl>();
     playMove = player.GetComponent<PlayerMovement>();
     playLife = player.GetComponent<PlayerLife>();
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        targetPosition = transform.position;
        transform.position += displacement;

        cameraControl = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraControl>();
        AudioSource.PlayClipAtPoint(whoosh, targetPosition);
    }
Пример #7
0
	public static CameraControl	get()
	{
		if(CameraControl.instance == null) {

			CameraControl.instance = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraControl>();
		}

		return(CameraControl.instance);
	}
Пример #8
0
 void Awake()
 {
     instance = this;
     var nodes = FindObjectsOfType<LevelNode>();
     cameraBounds.xMin = nodes.ExtMin(n => n.transform.position.x);
     cameraBounds.xMax = nodes.ExtMax(n => n.transform.position.x);
     cameraBounds.yMin = nodes.ExtMin(n => n.transform.position.y);
     cameraBounds.yMax = nodes.ExtMax(n => n.transform.position.y);
 }
Пример #9
0
 void Start () {
     cameraTransform = Camera.main.transform;
     cameraControl = cameraTransform.GetComponent<CameraControl>();
     cameraParent = cameraTransform.parent;
     playerControls = cameraParent.GetComponent<PlayerMovementControls>();
     playerMenuControls = cameraParent.GetComponent<PlayerMenuControls>();
     talkingBubble = GetComponentInParent<TalkingBubble>();
     canvas = GameObject.Find("Canvas").GetComponent<CanvasGroup>();
 }
    void Start()
    {
        mainCamera = GameObject.FindGameObjectWithTag(TagManager.MAIN_CAMERA);
        cameraControl = mainCamera.GetComponent<CameraControl>();
        hudLogic = GameObject.FindGameObjectWithTag(TagManager.GAME_CONTROLLER).GetComponent<ReplacementHUDLogic>();
        playerControl = GameObject.FindGameObjectWithTag(TagManager.PLAYER).GetComponent<PlayerControl>();

        rotationSpeed = 6f;
        inTrigger = false;
    }
Пример #11
0
    void Awake()
    {
        if(guiTexture) {

            // Store texture ratio
            ratio = guiTexture.pixelInset.width / guiTexture.pixelInset.height;
        }
        guiTexture.enabled = false;
        CCScript = GameObject.Find("CameraControl").GetComponent<CameraControl>();
    }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        //Destroy mouse input if Android detected
        if (Application.platform == RuntimePlatform.Android)
        {
            CameraMouseInput mouseInput = GetComponent<CameraMouseInput>();
            Destroy(mouseInput);
        }

        camControl = FindObjectOfType<CameraControl>();
    }
Пример #13
0
    //初期化///////////////////////////////////////////////////////////////
    void Awake()
    {
        m_Camera = GetComponentInChildren<CameraControl>();
        m_Camera.gameObject.name = this.gameObject.name + "Camera";
        m_Camera.DoWantFixdUpdate(true);
        m_Camera.DoWantLocalPos(false);
        m_Camera.DoWantLocalRot(false);
        m_Camera.smoothing = true;

        m_Camera.smoothRotSpeed = Mathf.PI / 2f;

        m_Camera.tarPos += Vector3.forward * 4;
    }
Пример #14
0
    void Start () {
        //Dependency "Player"
        player = GameObject.FindGameObjectWithTag("Player");
        playerInteract = GameObject.FindGameObjectWithTag("PLAYER_interact");
        plController = player.GetComponent<PlayerController>();
        plInteraction = playerInteract.GetComponent<Interaction>();
        //Dependency "Inventory"
        sprite_inventory = GameObject.FindGameObjectWithTag("GLOBAL_inventoryUI");
        inventoryUI = sprite_inventory.GetComponent<InventoryUI>();

        obj_camera = GameObject.FindGameObjectWithTag("GLOBAL_camera");
        camMov = obj_camera.GetComponent<CameraControl>();
	}
Пример #15
0
	void Start()
	{
		myCam = GetComponent(typeof(Camera)) as Camera;
		myTransform = myCam.transform;
		
		myInstance = this;
		
		gameObject.name = this.GetType().ToString();
		
		if (Grid.I.GetDoor != null)
			MoveCameraToBlock(Grid.I.GetDoor.currentBlockID);
		else
			MoveCameraToBlock(0);
	}
    private int m_TurnStepNo; //ステート番号

    #endregion Fields

    #region Methods

    //カメラ特殊処理///////////////////////////////////////////////////////////
    private void TurnCamFunc(CameraControl cam)
    {
        //At.Up
        cam.at = traPos - cam.pos + new Vector3(0, CAM_OFFSET.y, 0);
        cam.up = Vector3.up;

        //Pos
        if(m_TurnStepNo == 3) {
            //カメラ180度回転する処理
            //=#=#=#=#=#=#=#=#=#=#=#=#=#
            //=#  工事中              =#
            //=#=#=#=#=#=#=#=#=#=#=#=#=#
        }
    }
Пример #17
0
    // Use this for initialization
    void Start()
    {
        Screen.lockCursor = true;

        if (!cameraControl) {
            cameraControl = gameObject.GetComponent<CameraControl>();
        }
        if (!attachToSurface) {
            attachToSurface = gameObject.GetComponent<AttachToSurface>();
        }

        if (!jetPackStabilize) {
            jetPackStabilize = gameObject.GetComponent<JetPackStabilize>();
        }
    }
    public int RequestControl(CameraControlPriority priority, Transform target, Action onControlGained, Action onControlLost)
    {
        this.cameraControlDirty = true;

        CameraControl control = new CameraControl ();

        control.priority = priority;
        control.target = target;
        control.onControlGained = onControlGained;
        control.onControlLost = onControlLost;
        control.id = ++idCounter;

        listOfControls.Add (control);

        return control.id;
    }
Пример #19
0
    void Start()
    {
        //Dependency "Inventory"
        object_Inventory = GameObject.FindGameObjectWithTag("GLOBAL_inventory");
        inventory = object_Inventory.GetComponent<Inventory>();
        //Dependency "Player"
        player = GameObject.FindGameObjectWithTag("Player");

        list_pickup = new List<GameObject>();
        list_screech = new List<GameObject>();
        list_event = new List<GameObject>();

        list_temp = new List<GameObject>();
        list_var1 = new List<ObjectVariables>();

        micInput = player.GetComponent<SpawnByLoudness>();

        cameraObject = GameObject.FindGameObjectWithTag("GLOBAL_camera");
        camMov = cameraObject.GetComponent<CameraControl>();

        plController = transform.parent.gameObject.GetComponent<PlayerController>();
    }
 private void DeviceManager_PhotoCaptured(object sender, CameraControl.Devices.Classes.PhotoCapturedEventArgs eventArgs)
 {
     if (eventArgs != null)
     {
         this.PhotoCaptured(eventArgs);
     }
 }
Пример #21
0
 public override void Init(Enemy e, OnActionStateChanged onActionFinished)
 {
     base.Init(e, onActionFinished);
     cam = CameraControl.instance;
 }
Пример #22
0
 public override void OnEnter()
 {
     base.OnEnter();
     cameraControl = Owner.GetComponent <CameraControl>();
 }
Пример #23
0
 private void Awake()
 {
     _instance = this;
 }
Пример #24
0
        private void CameraDeviceSelectDialog_Load(object sender, EventArgs e)
        {
            List <string> devices = CameraControl.GetCameraDevice();

            cbb_CameraDevices.UpdateUI(devices, devices.FirstOrDefault());
        }
Пример #25
0
    //private float currentposx;
    //private float currentposy;

    //public new int damage = 50;

    void Start()
    {
        //currentposx = gameObject.transform.position.x;
        cc    = GameObject.Find("Main Camera").GetComponent <CameraControl>();
        speed = 0.04f;
    }
Пример #26
0
    public override void    execute()
    {
        CameraModule camera_module = CameraControl.get().getModule();

        // ---------------------------------------------------------------- //
        // 다음 상태로 전환할지 체크.

        switch (this.step.do_transition())
        {
        case STEP.IDLE:
        {
            this.step.set_next(STEP.START);
        }
        break;

        case STEP.START:
        {
            this.step.set_next(STEP.KABUSAN_TOJO);
        }
        break;

        case STEP.KABUSAN_TOJO:
        {
            if (this.step.get_time() > 2.0f)
            {
                this.step.set_next(STEP.KABUSAN_TALK);
            }
        }
        break;

        case STEP.KABUSAN_TALK:
        {
            if (Input.GetMouseButtonUp(0))
            {
                this.step.set_next(STEP.END);
            }
        }
        break;

        case STEP.END:
        {
            this.step.set_next(STEP.IDLE);
        }
        break;
        }

        // ---------------------------------------------------------------- //
        // 상태 전환 시 초기화.

        while (this.step.get_next() != STEP.NONE)
        {
            switch (this.step.do_initialize())
            {
            case STEP.IDLE:
            {
            }
            break;

            case STEP.START:
            {
                camera_module.parallelMoveTo(new Vector3(0.0f, 12.4f, -13.0f));
                this.step.set_next(STEP.KABUSAN_TOJO);
            }
            break;

            case STEP.KABUSAN_TOJO:
            {
            }
            break;

            case STEP.KABUSAN_TALK:
            {
                Navi.get().dispatchKabusanSpeech();
            }
            break;

            case STEP.END:
            {
                this.kabu_san.beginMove();
            }
            break;
            }
        }

        // ---------------------------------------------------------------- //
        // 각 상태에서의 실행 처리.

        switch (this.step.do_execution(Time.deltaTime))
        {
        case STEP.IDLE:
        {
        }
        break;
        }

        // ---------------------------------------------------------------- //
    }
Пример #27
0
 private void Awake()
 {
     instance = this;
     m_Camera = GetComponentInChildren <Camera>();
     m_Targets.Clear();
 }
Пример #28
0
 private void Awake()
 {
     control = this;
 }
 void Awake()
 {
     cameraControl = FindObjectOfType <CameraControl>();
 }
Пример #30
0
    public void BuildTheMaze(Save saveData)
    {
        data.LoadSavedData(saveData);
        setValues();

        maze        = new List <MazeNode>();
        solution    = new List <MazeNode>();
        toBeginning = new List <MazeNode>();
        toEnd       = new List <MazeNode>();
        ground      = new List <List <GameObject> > ();
        vertWalls   = new List <List <GameObject> > ();
        horiWalls   = new List <List <GameObject> > ();
        cam         = _camera.GetComponent <CameraControl> ();

        // ******************** Size Camera **********************

        _camera.transform.position = new Vector3((width - 1) * 5, (((17F / 3F) * height) - 6), -10);
        cam.setMax(((17f / 3f) * height) + 1);

        // ******************** Full Grid Build *************************

        if (width > 0 && height > 0)
        {
            o = Instantiate(goal, new Vector3((width - 1) * 10, (height - 1) * 10, -1), Quaternion.identity) as GameObject;
            o = Instantiate(baseFloor, new Vector3((width - 1) * 5, (height - 1) * 5, 3), Quaternion.Euler(270, 0, 0)) as GameObject;
            o.transform.localScale = new Vector3(width, 1, height);
            o.transform.parent     = floorParent.transform;

            for (int i = 0; i <= width; i++)
            {
                List <GameObject> column = new List <GameObject>();
                List <GameObject> vert   = new List <GameObject>();
                List <GameObject> hori   = new List <GameObject>();
                for (int j = 0; j < height; j++)
                {
                    if (i < width)
                    {
                        // Floors
                        o = Instantiate(floor,
                                        new Vector3(i * 10, j * 10, 1),
                                        Quaternion.Euler(270, 0, 0)) as GameObject;
                        o.GetComponent <FloorController>().x = i;
                        o.GetComponent <FloorController>().y = j;
                        o.transform.parent = floorParent.transform;
                        column.Add(o);
                        maze.Add(new MazeNode(i, j));

                        // Horizontal Walls
                        o = Instantiate(wall,
                                        new Vector3((i * 10) + 1, (j * 10) - 5, 0),
                                        Quaternion.Euler(0, -90, 90)) as GameObject;
                        o.transform.parent = wallParent.transform;
                        hori.Add(o);
                    }
                    // Vertical Walls
                    o = Instantiate(wall,
                                    new Vector3((i * 10) - 5, (j * 10) - 1, 0),
                                    Quaternion.Euler(-90, 0, 0)) as GameObject;
                    o.transform.parent = wallParent.transform;
                    vert.Add(o);
                }
                // Top Horizontal Walls
                if (i < width)
                {
                    o = Instantiate(wall,
                                    new Vector3((i * 10) + 1, (height * 10) - 5, 0),
                                    Quaternion.Euler(0, -90, 90)) as GameObject;
                }
                ground.Add(column);
                vertWalls.Add(vert);
                horiWalls.Add(hori);
            }
        }

        foreach (MazeNode node in maze)
        {
            node.FindAdjacentNodes(maze);
        }

        // ***************** Create Maze *******************

        for (int i = 0; i < maze.Count; i++)
        {
            foreach (direction dir in saveData.CurrentMaze[i].dir)
            {
                maze[i].forwards.Add(maze[i].AdjacentNodes[(int)dir]);
            }
        }

        foreach (MazeNodeData node in saveData.CurrentSolution)
        {
            solution.Add(new MazeNode(node.x, node.y));
        }

        // **************** Delete Walls to Form Maze *******************

        foreach (MazeNode node in maze)
        {
            if (node.forwards.Count > 0)
            {
                foreach (MazeNode forward in node.forwards)
                {
                    if (node.x != forward.x)
                    {
                        int x = Mathf.Max(node.x, forward.x);
                        if (vertWalls[x][node.y] != null)
                        {
                            vertWalls[x][node.y].transform.parent = null;
                            vertWalls[x][node.y].GetComponent <CustomColoring>().removeMe();
                            Destroy(vertWalls[x][node.y]);
                        }
                    }
                    if (node.y != forward.y)
                    {
                        int y = Mathf.Max(node.y, forward.y);
                        if (horiWalls[node.x][y] != null)
                        {
                            horiWalls[node.x][y].transform.parent = null;
                            horiWalls[node.x][y].GetComponent <CustomColoring>().removeMe();
                            Destroy(horiWalls[node.x][y]);
                        }
                    }
                }
            }
        }

        // ***************** Set Remaining Object to Maze Parent Object ***************

        current = maze[(saveData.CurrentPosition.x * height) + saveData.CurrentPosition.y];
        ClearMaze();
        SetClickZone(saveData.CurrentPosition.x, saveData.CurrentPosition.y);

        ColorPallet.SetIndex(SaveData.GetSave().ColorIndex);
        ColorPallet.CallRecolor();
        GamePlay.setRemainingFromSave(SaveData.GetSave().CurrentRemainingMoves);
        GamePlay.setScore(SaveData.GetSave().CurrentScore);

        MeshFilter[]      meshFilters = wallParent.GetComponentsInChildren <MeshFilter>();
        CombineInstance[] combine     = new CombineInstance[meshFilters.Length - 1];
        int z = 0;

        for (int n = 0; n < meshFilters.Length; n++)
        {
            if (meshFilters[n].sharedMesh == null)
            {
                continue;
            }
            combine[z].mesh        = meshFilters[n].sharedMesh;
            combine[z++].transform = meshFilters[n].transform.localToWorldMatrix;
            meshFilters[n].gameObject.SetActive(false);
        }
        wallParent.GetComponent <MeshFilter>().mesh = new Mesh();
        wallParent.GetComponent <MeshFilter>().mesh.CombineMeshes(combine);
        wallParent.gameObject.SetActive(true);

        // **************** Set Player Starting Position ******************************

        hero.transform.position = new Vector3(current.x, current.y, 0) * 10;
    }
Пример #31
0
 public void SetCameraParam(CameraControl control)
 {
     control.SetFieldOfView(23.5f);
     control.offset = new Vector3(0, 14f, -21f);
 }
Пример #32
0
    private void Awake()
    {
        player = new Controller();

        //Assign light variables to proper objects in scene
        lightSwitch    = GameObject.FindGameObjectWithTag("Lights");
        worldLighting  = GameObject.FindGameObjectWithTag("EnvironmentLights");
        backUpLighting = GameObject.FindGameObjectWithTag("BackUpLights");
        lightScript    = lightSwitch.GetComponent <LightScript>();
        //lightCooldown = 10f;
        lightEnable = true;

        //Assign gramophone variables to proper objects in scene
        gramophone  = GameObject.FindGameObjectWithTag("Gramophone");
        worldMusic  = GameObject.FindGameObjectWithTag("WorldMusic");
        musicScript = gramophone.GetComponent <GramophoneScript>();
        //musicCooldown = 10f;
        musicEnable = true;

        //Assign painting variables to proper objects in scene
        painting    = GameObject.FindGameObjectWithTag("Painting");
        paintScript = painting.GetComponent <PaintingScript>();
        //paintCooldown = 15f;
        paintEnable = true;

        prop       = GameObject.FindGameObjectWithTag("Prop");
        propScript = prop.GetComponent <PropScript>();

        //Assign player numbers and colors
        playernum = numplayers;
        numplayers++;

        //Add by Guanchen Liu
        //Assign nathan
        Nathan      = GameObject.Find("Nathan");
        humanScript = Nathan.GetComponent <HumanBehavior>();
        currentItem = selectedItem.None;
        currentCond = ghostCond.None;
        mainCamera  = GameObject.Find("MainCamera");
        sc          = mainCamera.GetComponent <CameraControl>();
        UI          = UIManager.instance.gameObject;
        var UICoolDown = UI.transform.Find("CoolDown").gameObject;

        // lightImage = UICoolDown.transform.GetChild(0).GetComponent<Image>();
        // musicImage = UICoolDown.transform.GetChild(1).GetComponent<Image>();
        // paintImage = UICoolDown.transform.GetChild(2).GetComponent<Image>();


        player.Gameplay.Grabbing.canceled += context => ReleaseObject();

        if (playernum == 0)
        {
            GameObject temp = GameObject.Find("Ghost_1");
            transform.position = temp.transform.position;
            Destroy(temp);
            mesh.material   = color1;
            gameObject.name = "Ghost_1";
        }
        if (playernum == 1)
        {
            GameObject temp = GameObject.Find("Ghost_2");
            transform.position = temp.transform.position;
            Destroy(temp);
            mesh.material   = color2;
            gameObject.name = "Ghost_2";
            backUpLighting.gameObject.SetActive(false);
            var UIScript = UI.GetComponent <UIManager>();
            Time.timeScale = 1.0f;
            UIScript.playStartImage();
        }

        var allGhost = GameObject.FindGameObjectsWithTag("Ghost");

        choreManger = GameObject.Find("ChoreManger").GetComponent <ChoreManger>();
    }
Пример #33
0
 private void InitializeComponent()
 {
     this.cameraControl      = new Anda.Fluid.Domain.Vision.CameraControl();
     this.findCircle         = new Anda.Fluid.Domain.SVO.SubForms.FindCircle();
     this.lblCycles          = new System.Windows.Forms.Label();
     this.lblTolerance       = new System.Windows.Forms.Label();
     this.labelZOffsetResult = new System.Windows.Forms.Label();
     this.txtZOffsetResult   = new System.Windows.Forms.TextBox();
     this.txtTolerance       = new System.Windows.Forms.TextBox();
     this.lblDiagram         = new System.Windows.Forms.Label();
     this.picDiagram         = new System.Windows.Forms.PictureBox();
     this.btnStopMotion      = new System.Windows.Forms.Button();
     this.nudCycles          = new System.Windows.Forms.NumericUpDown();
     this.grpOperation.SuspendLayout();
     this.grpResultTest.SuspendLayout();
     this.pnlDisplay.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.picDiagram)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nudCycles)).BeginInit();
     this.SuspendLayout();
     //
     // grpResultTest
     //
     this.grpResultTest.Controls.Add(this.nudCycles);
     this.grpResultTest.Controls.Add(this.btnStopMotion);
     this.grpResultTest.Controls.Add(this.lblCycles);
     this.grpResultTest.Controls.Add(this.lblTolerance);
     this.grpResultTest.Controls.Add(this.labelZOffsetResult);
     this.grpResultTest.Controls.Add(this.txtZOffsetResult);
     this.grpResultTest.Controls.Add(this.txtTolerance);
     this.grpResultTest.Controls.Add(this.findCircle);
     //
     // pnlDisplay
     //
     this.pnlDisplay.Controls.Add(this.picDiagram);
     this.pnlDisplay.Controls.Add(this.lblDiagram);
     //
     // cameraControl
     //
     this.cameraControl.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
     this.cameraControl.Location  = new System.Drawing.Point(0, 0);
     this.cameraControl.Name      = "cameraControl";
     this.cameraControl.Size      = this.pnlDisplay.Size;
     this.cameraControl.TabIndex  = 0;
     //
     // findCircle
     //
     this.findCircle.Location = new System.Drawing.Point(4, 10);
     this.findCircle.Name     = "findCircle";
     this.findCircle.Size     = new System.Drawing.Size(448, 90);
     this.findCircle.TabIndex = 0;
     //
     // lblCycles
     //
     this.lblCycles.AutoSize = true;
     this.lblCycles.Location = new System.Drawing.Point(88, 127);
     this.lblCycles.Name     = "lblCycles";
     this.lblCycles.Size     = new System.Drawing.Size(119, 12);
     this.lblCycles.TabIndex = 11;
     this.lblCycles.Text     = "Measurement cycles:";
     //
     // lblTolerance
     //
     this.lblTolerance.AutoSize = true;
     this.lblTolerance.Location = new System.Drawing.Point(76, 153);
     this.lblTolerance.Name     = "lblTolerance";
     this.lblTolerance.Size     = new System.Drawing.Size(131, 12);
     this.lblTolerance.TabIndex = 12;
     this.lblTolerance.Text     = "Offset tolerance +/-:";
     //
     // labelZOffsetResult
     //
     this.labelZOffsetResult.AutoSize = true;
     this.labelZOffsetResult.Location = new System.Drawing.Point(56, 182);
     this.labelZOffsetResult.Name     = "labelZOffsetResult";
     this.labelZOffsetResult.Size     = new System.Drawing.Size(155, 12);
     this.labelZOffsetResult.TabIndex = 13;
     this.labelZOffsetResult.Text     = "Needle to probe Z offset:";
     //
     // txtZOffsetResult
     //
     this.txtZOffsetResult.Location = new System.Drawing.Point(213, 177);
     this.txtZOffsetResult.Name     = "txtZOffsetResult";
     this.txtZOffsetResult.Size     = new System.Drawing.Size(72, 21);
     this.txtZOffsetResult.TabIndex = 16;
     //
     // txtTolerance
     //
     this.txtTolerance.Enabled  = false;
     this.txtTolerance.Location = new System.Drawing.Point(213, 150);
     this.txtTolerance.Name     = "txtTolerance";
     this.txtTolerance.Size     = new System.Drawing.Size(72, 21);
     this.txtTolerance.TabIndex = 15;
     this.txtTolerance.Text     = "0.02";
     //
     // lblDiagram
     //
     this.lblDiagram.AutoSize = true;
     this.lblDiagram.Location = new System.Drawing.Point(16, 26);
     this.lblDiagram.Name     = "lblDiagram";
     this.lblDiagram.Size     = new System.Drawing.Size(155, 216);
     this.lblDiagram.TabIndex = 0;
     this.lblDiagram.Text     = "Teach center of tactile\r\nusing camera\r\n\r\n\r\n\r\n\r\nTeach one center point\r\n\r\n        " +
                                "   or\r\n\r\nTeach three circumference\r\npoints\r\n\r\n\r\n\r\n\r\nWARNING:Dispenser will\r\nmove" +
                                " after your response";
     //
     // picDiagram
     //
     this.picDiagram.Location = new System.Drawing.Point(177, 26);
     this.picDiagram.Name     = "picDiagram";
     this.picDiagram.Size     = new System.Drawing.Size(254, 332);
     this.picDiagram.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.picDiagram.TabIndex = 1;
     this.picDiagram.TabStop  = false;
     //
     // btnStopMotion
     //
     this.btnStopMotion.BackColor = System.Drawing.SystemColors.Control;
     this.btnStopMotion.Enabled   = false;
     this.btnStopMotion.Location  = new System.Drawing.Point(330, 150);
     this.btnStopMotion.Name      = "btnStopMotion";
     this.btnStopMotion.Size      = new System.Drawing.Size(75, 23);
     this.btnStopMotion.TabIndex  = 17;
     this.btnStopMotion.Text      = "Stop";
     this.btnStopMotion.UseVisualStyleBackColor = false;
     this.btnStopMotion.Click += new System.EventHandler(this.btnStopMotion_Click);
     //
     // nudCycles
     //
     this.nudCycles.Location = new System.Drawing.Point(214, 121);
     this.nudCycles.Maximum  = new decimal(new int[] {
         10,
         0,
         0,
         0
     });
     this.nudCycles.Minimum = new decimal(new int[] {
         2,
         0,
         0,
         0
     });
     this.nudCycles.Name     = "nudCycles";
     this.nudCycles.Size     = new System.Drawing.Size(71, 21);
     this.nudCycles.TabIndex = 18;
     this.nudCycles.Value    = new decimal(new int[] {
         3,
         0,
         0,
         0
     });
     //
     // TeachNeedleToHeightSensor
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.ClientSize          = new System.Drawing.Size(671, 690);
     this.Name         = "TeachNeedleToHeightSensor";
     this.Text         = "Anda Fluid move - Teach Needle to Height Sensor Z Offset";
     this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TeachNeedleToHeightSensor_FormClosing);
     this.Load        += new System.EventHandler(this.TeachNeedleToHeightSensor_Load);
     this.grpOperation.ResumeLayout(false);
     this.grpResultTest.ResumeLayout(false);
     this.grpResultTest.PerformLayout();
     this.pnlDisplay.ResumeLayout(false);
     this.pnlDisplay.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.picDiagram)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nudCycles)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Пример #34
0
 void Start()
 {
     Player  = GetComponent <PlayerBhysics>();
     Actions = GetComponent <ActionManager>();
     Cam     = GetComponent <CameraControl>();
 }
Пример #35
0
 void Awake()
 {
     cameraControlRef = Camera.main.GetComponent <CameraControl>();
 }
Пример #36
0
 void Awake()
 {
     Instance = this;
 }
Пример #37
0
 // Use this for initialization
 void Start()       //Find needed Objects
 {
     player      = FindObjectOfType <PlayerController> ();
     camera_main = FindObjectOfType <CameraControl> ();
     HPManager   = FindObjectOfType <HealthManager> ();
 }
 void Start()
 {
     Init();
     _camControl = Camera.main.GetComponent <CameraControl>();
 }
Пример #39
0
 private void InitializeComponent()
 {
     this.picDiagram        = new System.Windows.Forms.PictureBox();
     this.lblDiagram        = new System.Windows.Forms.Label();
     this.txtCenterZ        = new System.Windows.Forms.TextBox();
     this.txtCenterY        = new System.Windows.Forms.TextBox();
     this.txtCenterX        = new System.Windows.Forms.TextBox();
     this.lblCenterLocation = new System.Windows.Forms.Label();
     this.findCircle        = new Anda.Fluid.Domain.SVO.SubForms.FindCircle();
     this.cameraControl     = new Anda.Fluid.Domain.Vision.CameraControl();
     this.lblZDistance      = new System.Windows.Forms.Label();
     this.nudZDistance      = new System.Windows.Forms.NumericUpDown();
     this.btnTeachZ         = new System.Windows.Forms.Button();
     this.grpOperation.SuspendLayout();
     this.grpResultTest.SuspendLayout();
     this.pnlDisplay.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.picDiagram)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.nudZDistance)).BeginInit();
     this.SuspendLayout();
     //
     // grpResultTest
     //
     this.grpResultTest.Controls.Add(this.btnTeachZ);
     this.grpResultTest.Controls.Add(this.nudZDistance);
     this.grpResultTest.Controls.Add(this.lblZDistance);
     this.grpResultTest.Controls.Add(this.txtCenterZ);
     this.grpResultTest.Controls.Add(this.txtCenterY);
     this.grpResultTest.Controls.Add(this.txtCenterX);
     this.grpResultTest.Controls.Add(this.lblCenterLocation);
     this.grpResultTest.Controls.Add(this.findCircle);
     //
     // pnlDisplay
     //
     this.pnlDisplay.Controls.Add(this.picDiagram);
     this.pnlDisplay.Controls.Add(this.lblDiagram);
     //
     // picDiagram
     //
     this.picDiagram.Location = new System.Drawing.Point(179, 34);
     this.picDiagram.Name     = "picDiagram";
     this.picDiagram.Size     = new System.Drawing.Size(290, 332);
     this.picDiagram.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.picDiagram.TabIndex = 5;
     this.picDiagram.TabStop  = false;
     //
     // lblDiagram
     //
     this.lblDiagram.AutoSize = true;
     this.lblDiagram.Location = new System.Drawing.Point(18, 34);
     this.lblDiagram.Name     = "lblDiagram";
     this.lblDiagram.Size     = new System.Drawing.Size(155, 216);
     this.lblDiagram.TabIndex = 4;
     this.lblDiagram.Text     = "Teach Scale location\r\nusing camera\r\n\r\n\r\n\r\n\r\nTeach one center point\r\n\r\n           " +
                                "or\r\n\r\nTeach three circumference\r\npoints\r\n\r\n\r\n\r\n\r\nWARNING:Dispenser will\r\nmove af" +
                                "ter your response";
     //
     // txtCenterZ
     //
     this.txtCenterZ.Enabled  = false;
     this.txtCenterZ.Location = new System.Drawing.Point(371, 124);
     this.txtCenterZ.Name     = "txtCenterZ";
     this.txtCenterZ.Size     = new System.Drawing.Size(72, 21);
     this.txtCenterZ.TabIndex = 9;
     //
     // txtCenterY
     //
     this.txtCenterY.Enabled  = false;
     this.txtCenterY.Location = new System.Drawing.Point(278, 124);
     this.txtCenterY.Name     = "txtCenterY";
     this.txtCenterY.Size     = new System.Drawing.Size(72, 21);
     this.txtCenterY.TabIndex = 8;
     //
     // txtCenterX
     //
     this.txtCenterX.Enabled  = false;
     this.txtCenterX.Location = new System.Drawing.Point(185, 124);
     this.txtCenterX.Name     = "txtCenterX";
     this.txtCenterX.Size     = new System.Drawing.Size(72, 21);
     this.txtCenterX.TabIndex = 7;
     //
     // lblCenterLocation
     //
     this.lblCenterLocation.AutoSize = true;
     this.lblCenterLocation.Location = new System.Drawing.Point(66, 127);
     this.lblCenterLocation.Name     = "lblCenterLocation";
     this.lblCenterLocation.Size     = new System.Drawing.Size(113, 12);
     this.lblCenterLocation.TabIndex = 6;
     this.lblCenterLocation.Text     = "Center Location : ";
     //
     // findCircle
     //
     this.findCircle.Location = new System.Drawing.Point(31, 28);
     this.findCircle.Name     = "findCircle";
     this.findCircle.Size     = new System.Drawing.Size(450, 90);
     this.findCircle.TabIndex = 5;
     //
     // cameraControl
     //
     this.cameraControl.Font     = new System.Drawing.Font("Verdana", 7.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.cameraControl.Location = new System.Drawing.Point(0, 0);
     this.cameraControl.Name     = "cameraControl";
     this.cameraControl.Size     = this.pnlDisplay.Size;
     this.cameraControl.TabIndex = 0;
     //
     // lblZDistance
     //
     this.lblZDistance.AutoSize = true;
     this.lblZDistance.Location = new System.Drawing.Point(29, 159);
     this.lblZDistance.Name     = "lblZDistance";
     this.lblZDistance.Size     = new System.Drawing.Size(275, 24);
     this.lblZDistance.TabIndex = 10;
     this.lblZDistance.Text     = "Desired Z distance between needle and cup lid\r\n(+=below lid,-=above lid)";
     //
     // nudZDistance
     //
     this.nudZDistance.DecimalPlaces = 4;
     this.nudZDistance.Location      = new System.Drawing.Point(325, 157);
     this.nudZDistance.Maximum       = new decimal(new int[] {
         1000,
         0,
         0,
         0
     });
     this.nudZDistance.Minimum = new decimal(new int[] {
         1000,
         0,
         0,
         -2147483648
     });
     this.nudZDistance.Name     = "nudZDistance";
     this.nudZDistance.Size     = new System.Drawing.Size(72, 21);
     this.nudZDistance.TabIndex = 11;
     //
     // btnTeachZ
     //
     this.btnTeachZ.Enabled  = false;
     this.btnTeachZ.Location = new System.Drawing.Point(419, 156);
     this.btnTeachZ.Name     = "btnTeachZ";
     this.btnTeachZ.Size     = new System.Drawing.Size(56, 23);
     this.btnTeachZ.TabIndex = 12;
     this.btnTeachZ.Text     = "Teach Z";
     this.btnTeachZ.UseVisualStyleBackColor = true;
     this.btnTeachZ.Click += new System.EventHandler(this.btnTeachZ_Click);
     //
     // TeachScale
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.ClientSize          = new System.Drawing.Size(723, 657);
     this.Name         = "TeachScale";
     this.Text         = "Anda Fluidmove - Teach location for Valve Scale location";
     this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TeachScale_FormClosing);
     this.Load        += new System.EventHandler(this.TeachScale_Load);
     this.grpOperation.ResumeLayout(false);
     this.grpResultTest.ResumeLayout(false);
     this.grpResultTest.PerformLayout();
     this.pnlDisplay.ResumeLayout(false);
     this.pnlDisplay.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.picDiagram)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.nudZDistance)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Пример #40
0
 private void OnEnable()
 {
     _this            = this;
     originalPosition = transform.position;
 }
Пример #41
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()
 {
     cameraControl = FindObjectOfType <CameraControl>();
     Debug.Assert(cameraControl && startScreen && pauseMenu && defeatMenu && victoryMenu && levelUI && defeatAttempts && goldAmount, "Wrong initial parameters");
 }
Пример #42
0
	private void Awake (){
		main = this;
		m_Camera = GetComponentInChildren<Camera> ();
	}
Пример #43
0
 // Use this for initialization
 void Start()
 {
     m_transform         = GetComponent <RectTransform>();
     mainCamera          = Camera.main;
     cameraControlScript = mainCamera.GetComponent <CameraControl>();
 }
Пример #44
0
//	void Start() {
//		if (gameManager == null)
//			gameManager = this;
//		gameStarted = false;
//		_mapChoice = 1;
//		playerCount = players.Length;
//		_MoveSpeedValue = 5;
//		_HitForceValue = 200;
//		_JumpForceValue = 200;
//		_HookDistance = 8;
//		_HookReloadTimeValue = 3;
//		_HammerReloadTimeValue = 1.5f;
//		_ItemProbabilityValue = 40;
//	}

    // Use this for initialization
    void Awake()
    {
        if (gameManager == null)
        {
            gameManager = this;
        }
        else if (gameManager != this)
        {
            Destroy(gameObject);
        }



        if (gameManager.gameStarted)
        {
            // print("??");
            //gameManager.mapManager = GameObject.Find("MapManager").GetComponent<MapManager>();
            isGameOver          = false;
            gameManager.winText = GameObject.Find("Canvas").GetComponentInChildren <Text>();
            gameManager.winText.gameObject.SetActive(false);
            gameManager.inGameParticlesAndEffects = GameObject.Find("InGame Particles and Effects");
            gameManager.mapHolder = GameObject.Find("Map Holder");
            time = 0;
            Map m = Instantiate(map);
            m.transform.name = "Map " + (gameManager._mapChoice + 1);
            m.transform.SetParent(gameManager.mapHolder.transform);
            for (int i = 0; i < 4; i++)
            {
                GameObject player = (GameObject)Instantiate(gameManager.players [i]);
                gameManager.players [i] = player;
                player.transform.name   = "Player " + (i + 1);
                PlayerController playerController = player.GetComponent <PlayerController> ();
                playerController.MaxVelocity  = 5 + 2 * _MoveSpeedValue;
                playerController.HealthScalar = 200 + 75 * _HitForceValue;
                playerController.JumpForce    = 200 + 100 * _JumpForceValue;
                playerController.HookDistance = 8 + 3 * _HookDistance;
                playerController.ReloadHook   = 3 + _HookReloadTimeValue;
                playerController.ReloadHammer = 1.5f + _HammerReloadTimeValue;

                gameManager.playersInGame += 1;
                Debug.Log("playercount = " + gameManager.playersInGame);
            }
            m.SpawnMap(gameManager._mapChoice, 4);
            GameObject    camHolder = GameObject.Find("Camera Holder");
            CameraControl cam       = camHolder.GetComponentInChildren <CameraControl> ();
            cam.SetUpCamera();
        }



        //InstantiateItems();

        /*for (int i = 0; i < MapLibrary.mapCount; i++)
         * {
         *  Map m = Instantiate(map);
         *  m.transform.name = "Map " + (i + 1);
         *  m.transform.position += new Vector3(i * 50, 0, 0);
         *  //m.gameObject.SetActive(i == selectedMap);
         *  m.transform.SetParent(mapHolder.transform);
         * }*/
//
//        for (int i = 0; i < MapLibrary.bitmaps.Length; i++)
//        {
//            Map m = Instantiate(map);
//            m.transform.name = "Map " + (i + 1);
//            m.transform.position += new Vector3(i * 50, 0, 0);
//            m.transform.SetParent(mapHolder.transform);
//        }
        DontDestroyOnLoad(this);
    }
Пример #45
0
    public virtual void Init()
    {
        if (myNet) {
            myNet.RPC("SetUseCardBoard",RPCMode.AllBuffered,_UseCardBoard);
        }

        PlayerSpawnPoint = new Vector3(Random.Range(-9,6),0f,Random.Range(-9,9));

        if (ReferencePlayerObject != null) {
            _playerChar = ((GameObject)Network.Instantiate (ReferencePlayerObject, PlayerSpawnPoint, Quaternion.identity, 0)).GetComponent<CharacterStateMachine> ();
            InitCharacter (_playerChar);
        }

        VerifyUseCardBoard ();
        if (_referenceCamControlToUse != null) {
            _currentCamControl = ((GameObject)GameObject.Instantiate (_referenceCamControlToUse.gameObject)).GetComponent<CameraControl> ();
        }
        //WP.Controller.ControllerUtility.OnControllerModeChanged += OnControllerModeChanged;
    }
Пример #46
0
	private Vector3 m_MoveVelocity;                 // Reference velocity for the smooth damping of the position.



	private void Awake() {
		sInstance = this;
		m_Camera = GetComponentsInChildren<Camera> ();
	}
 //カメラ特殊処理///////////////////////////////////////////////////////////
 private void GoalCamFunc(CameraControl cam)
 {
     cam.at = traPos - cam.pos + new Vector3(0, CAM_OFFSET.y, 0);
     cam.up = Vector3.up;
 }
Пример #48
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.main_camera = GameObject.Find("Main Camera").GetComponent<CameraControl>();

        // ------------------------------------------------------------ //
        // 입과 눈.

        this.mouths = new List<GameObject>();
        this.eyes   = new List<GameObject>();

        this.face = this.transform.FindChild("face").gameObject;
        this.face_center = this.face.transform.localPosition.z;

        // 입.

        Transform	mouth_root = this.face.transform.FindChild("mouth");

        for(int i = 0;i < (int)MOUTH_TYPE.NUM;i++) {

            this.mouths.Add(null);

            Transform	t = mouth_root.FindChild("mouth" + i);

            if(t == null) {

                continue;
            }

            this.mouths[i] = t.gameObject;
        }

        this.change_mouth_type(this.mouth_type);

        // 눈.

        for(int i = 0;i < (int)EYE_TYPE.NUM;i++) {

            this.eyes.Add(null);

            Transform	t = this.face.transform.FindChild("eye" + i);

            if(t == null) {

                continue;
            }

            this.eyes[i] = t.gameObject;
        }

        this.eye_type    = EYE_TYPE.OPEN;
        this.blink_timer = 0.0f;
        this.change_eye_type();

        // ------------------------------------------------------------ //

        this.cloud_root = GameObject.Find("Game Root").GetComponent<CloudRoot>();

        this.timer = 0.0f;
    }
Пример #49
0
 private void Awake()
 {
     camera = GetComponent <Camera>();
     ins    = this;
 }
Пример #50
0
 // Use this for initialization
 void Start()
 {
     gamePlane = new Plane(Vector3.zero, Vector3.up, Vector3.right);
     _rigidbody = GetComponent<Rigidbody>();
     instance = this;
 }
Пример #51
0
 public virtual void Init()
 {
     if (ReferencePlayerObject != null) {
         _playerChar = ((GameObject)Network.Instantiate (ReferencePlayerObject, PlayerSpawnPoint, Quaternion.identity, 0)).GetComponent<CharacterStateMachine> ();
         InitCharacter (_playerChar);
     }
     VerifyUseOculus ();
     if (_referenceCamControlToUse != null) {
         _currentCamControl = ((GameObject)GameObject.Instantiate (_referenceCamControlToUse.gameObject)).GetComponent<CameraControl> ();
     }
 }
Пример #52
0
    public void BuildTheMaze()
    {
        setValues();

        maze        = new List <MazeNode>();
        solution    = new List <MazeNode>();
        toBeginning = new List <MazeNode>();
        toEnd       = new List <MazeNode>();
        ground      = new List <List <GameObject> > ();
        vertWalls   = new List <List <GameObject> > ();
        horiWalls   = new List <List <GameObject> > ();
        cam         = _camera.GetComponent <CameraControl> ();

        // ******************** Size Camera **********************

        _camera.transform.position = new Vector3((width - 1) * 5, (((17F / 3F) * height) - 6), -10);
        cam.setMax(((17f / 3f) * height) + 1);

        // ******************** Full Grid Build *************************

        if (width > 0 && height > 0)
        {
            o = Instantiate(goal, new Vector3((width - 1) * 10, (height - 1) * 10, -1), Quaternion.identity) as GameObject;
            o = Instantiate(baseFloor, new Vector3((width - 1) * 5, (height - 1) * 5, 3), Quaternion.Euler(270, 0, 0)) as GameObject;
            o.transform.localScale = new Vector3(width, 1, height);
            o.transform.parent     = floorParent.transform;

            for (int i = 0; i <= width; i++)
            {
                List <GameObject> column = new List <GameObject>();
                List <GameObject> vert   = new List <GameObject>();
                List <GameObject> hori   = new List <GameObject>();
                for (int j = 0; j < height; j++)
                {
                    if (i < width)
                    {
                        // Floors
                        o = Instantiate(floor,
                                        new Vector3(i * 10, j * 10, 1),
                                        Quaternion.Euler(270, 0, 0)) as GameObject;
                        o.GetComponent <FloorController>().x = i;
                        o.GetComponent <FloorController>().y = j;
                        o.transform.parent = floorParent.transform;
                        column.Add(o);
                        maze.Add(new MazeNode(i, j));

                        // Horizontal Walls
                        o = Instantiate(wall,
                                        new Vector3((i * 10) + 1, (j * 10) - 5, 0),
                                        Quaternion.Euler(0, -90, 90)) as GameObject;
                        o.transform.parent = wallParent.transform;
                        hori.Add(o);
                    }
                    // Vertical Walls
                    o = Instantiate(wall,
                                    new Vector3((i * 10) - 5, (j * 10) - 1, 0),
                                    Quaternion.Euler(-90, 0, 0)) as GameObject;
                    o.transform.parent = wallParent.transform;
                    vert.Add(o);
                }
                // Top Horizontal Walls
                if (i < width)
                {
                    o = Instantiate(wall,
                                    new Vector3((i * 10) + 1, (height * 10) - 5, 0),
                                    Quaternion.Euler(0, -90, 90)) as GameObject;
                    o.transform.parent = wallParent.transform;
                }
                ground.Add(column);
                vertWalls.Add(vert);
                horiWalls.Add(hori);
            }
        }

        foreach (MazeNode node in maze)
        {
            node.FindAdjacentNodes(maze);
        }

        // ***************** Create Maze *******************

        start       = maze[Random.Range(0, maze.Count)];
        start.start = true;
        start.makeMaze();
        solution = GetSolution(toBeginning, toEnd);

        // **************** Delete Walls to Form Maze *******************

        foreach (MazeNode node in maze)
        {
            if (node.back != null)
            {
                if (node.back.x != node.x)
                {
                    vertWalls[Mathf.Max(node.x, node.back.x)][node.y].transform.parent = null;
                    vertWalls[Mathf.Max(node.x, node.back.x)][node.y].GetComponent <CustomColoring>().removeMe();
                    Destroy(vertWalls[Mathf.Max(node.x, node.back.x)][node.y]);
                }
                if (node.back.y != node.y)
                {
                    horiWalls[node.x][Mathf.Max(node.y, node.back.y)].transform.parent = null;
                    horiWalls[node.x][Mathf.Max(node.y, node.back.y)].GetComponent <CustomColoring>().removeMe();
                    Destroy(horiWalls[node.x][Mathf.Max(node.y, node.back.y)]);
                }
            }
        }

        // ***************** Set Remaining Object to Maze Parent Object ***************

        current = maze[0];
        ClearMaze();
        SetClickZone(0, 0);

        ColorPallet.SetIndex(SaveData.GetSave().ColorIndex);
        ColorPallet.CallRecolor();
        GamePlay.setRemaining(solution.Count);

        MeshFilter[]      meshFilters = wallParent.GetComponentsInChildren <MeshFilter>();
        CombineInstance[] combine     = new CombineInstance[meshFilters.Length - 1];
        int z = 0;

        for (int n = 0; n < meshFilters.Length; n++)
        {
            if (meshFilters[n].sharedMesh == null)
            {
                continue;
            }
            combine[z].mesh        = meshFilters[n].sharedMesh;
            combine[z++].transform = meshFilters[n].transform.localToWorldMatrix;
            meshFilters[n].gameObject.SetActive(false);
        }
        wallParent.GetComponent <MeshFilter>().mesh = new Mesh();
        wallParent.GetComponent <MeshFilter>().mesh.CombineMeshes(combine);
        wallParent.gameObject.SetActive(true);

        // ****************** Save Maze ***********************************************

        List <MazeNodeData> mazeData = new List <MazeNodeData>();

        foreach (MazeNode node in maze)
        {
            mazeData.Add(node.convertToMazeNodeData());
        }
        List <MazeNodeData> solutionData = new List <MazeNodeData>();

        foreach (MazeNode node in solution)
        {
            solutionData.Add(node.convertToMazeNodeData());
        }
        SaveData.savePuzzle(mazeData, level, solutionData, width, height);
        SaveData.saveMove(new MazeNodeData(0, 0), GamePlay.getCounter(), GamePlay.getScore());
    }
Пример #53
0
 private void Awake()
 {
     m_spyMovement   = m_spyObj.GetComponent <SpyMovement>();
     m_CGController  = m_CGControllerObj.GetComponent <CGController>();
     m_camController = m_spyCamObj.GetComponent <CameraControl>();
 }
Пример #54
0
 void Start()
 {
     //Get camera controller
     cam = GetComponent <CameraControl>();
 }
Пример #55
0
 void Awake()
 {
     instance = this;
 }
Пример #56
0
 private void Start()
 {
     CamControl = FindObjectOfType <CameraControl>();
     sound      = FindObjectOfType <PlayerSound>();
 }
Пример #57
0
 protected void VerifyUseOculus()
 {
     if (_UseOculus) {
         _referenceCamControlToUse = OculusCamControl;
     } else {
         _referenceCamControlToUse = CamControl;
     }
 }
Пример #58
0
 // Use this for initialization
 void Start()
 {
     player         = GameObject.Find("Player");
     cameraControl  = player.GetComponent <CameraControl>();
     reticlePointer = GameObject.Find("GvrReticlePointer").GetComponent <GvrReticlePointer>();
 }
Пример #59
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        _global = GameObject.Find("Global").GetComponent<Global>();
        spawner = GetComponent<Spawner>();
        cameraControl = GetComponent<CameraControl>();

        tool = 0;
        tools = new[]{Textures.Block, Textures.Mark, Textures.Inspect};
        windowRect = new Rect(w_2 - (w_2 / 2f), h_2 - (h_2 / 2f), w_2, h_2);
    }
Пример #60
0
 public void entry(CameraControl camControl)
 {
 }