// Use this for initialization void Start() { Main = gameObject.GetComponent <ControlPanel>(); CooSystem_script = gameObject.GetComponent <CooSystem>(); MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); CompileNC_script = gameObject.GetComponent <CompileNC>(); }
// Use this for initialization void Start() { MoveControlScript = GameObject.Find("move_control").GetComponent <MoveControl>(); rotate_ref = GameObject.Find("rotate_ref").transform; round_dot_transform = GameObject.Find("zero").transform; move_sound = (AudioClip)Resources.Load("Audio/move"); }
private void Awake() { hookGunObj = transform.GetChild(0).gameObject; hookObj = hookGunObj.transform.GetChild(0).gameObject; hookGun = hookGunObj.GetComponent <HookGun>(); moveControl = GetComponent <MoveControl>(); }
protected override void EnterSpecialAttack2State() { aniControlBoss.IsSpecialAttack2 = true; MoveControl.Stop(); MoveControl.LookAt(PlayerTarget.position); //MoveControl.Move(PlayerTarget.position); }
protected override void LeaveSpecialAttack2State() { MoveControl.Stop(); timer = 0; actualBossAttackSpecial.IsCooldownActive = true; Weapon.SpecialAttackOff_2(); }
protected override void UpdateFollowState() { #region Action MoveControl.Move(PlayerTarget.position); MoveControl.LookAt(PlayerTarget.position); aniControlBoss.SpeedPercent = MoveControl.Magnitude / 2; #endregion #region Transtions float pointDistance = Distance(MonitoringPoint.position, transform.position); if (pointDistance > RadiusLimitMonitoringPoint) { // Personagem muito longe do ponto de origem // EnterState(TypeStateCharacter.Back); return; } float playerDistance = Distance(PlayerTarget.position, transform.position); if (playerDistance > RadiusPlayerDistance) { // Detectou o jogador // EnterState(TypeStateCharacter.Back); return; } if (playerDistance <= RadiusAttack) { // Detectou o jogador e está em área de ataque // //EnterState(TypeStateCharacter.Attack); AttacksVerification(); return; } #endregion }
// Use this for initialization void Start() { /* * tryCreate = (GameObject)Resources.Load("EmptyObject"); * Instantiate(tryCreate); * tryCreate.transform.name = "tryCreate"; */ NCCodeFormat_Script = GameObject.Find("MainScript").GetComponent <NCCodeFormat>(); ProgramModule_Script = GameObject.Find("MainScript").GetComponent <ProgramModule>(); CooSystem_Script = GameObject.Find("MainScript").GetComponent <CooSystem>(); Main = GameObject.Find("MainScript").GetComponent <ControlPanel>(); Auto_Script = GameObject.Find("AutoMove").GetComponent <AutoMoveModule>(); Move_Script = GameObject.Find("move_control").GetComponent <MoveControl>(); SpindleControl_script = GameObject.Find("spindle_control").GetComponent <SpindleControl>(); PathLineDraw_Script = GameObject.Find("Main Camera").GetComponent <PathLineDraw>(); AutoToolChange_Script = GameObject.Find("ToolChange").GetComponent <AutoToolChangeModule>(); Warnning_Script = gameObject.GetComponent <Warnning>(); Softkey_Script = gameObject.GetComponent <SoftkeyModule>(); CooZeroPoint = new Vector3(0, 0, 0); singleStepEnd = 100; CurrentModal = new ModalCode_Fanuc_M(); // CurrentModal.RotateSpeed = 3000; GameObject ForCuttingWork = GameObject.Find("GameObject"); if (ForCuttingWork == null) { Debug.LogError("请添加空物体GameObject!"); return; } ForCuttingWork.name = "CuttingWork"; ForCuttingWork.AddComponent <CuttingWork>(); CuttingWork_Script = ForCuttingWork.GetComponent <CuttingWork>(); }
private void initialize() { leftShips = new List <int>(Parameters.ships); moveControl = new MoveControl(new Point(0, 0)); shipControl = new ShipControl(leftShips); field = new Field(); shipControl.createNewShip(0); }
private void Start() { loco = GetComponent <MoveControl>(); foreach (Station station in stations) { station.CanLoadAction += OnStation; } }
// Use this for initialization void Start() { ControlPanel_script = gameObject.GetComponent <ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); ReadCooFile(); workpiece_coo = G54_pos; workpiece_flag = 1; }
// Use this for initialization void Start() { // gameObject.AddComponent("MeshCollider"); // gameObject.AddComponent("Rigidbody"); // gameObject.rigidbody.useGravity = false; // gameObject.rigidbody.isKinematic = false; MoveControl_Script = GameObject.Find("move_control").GetComponent <MoveControl>(); }
private void Awake() { MoveControl = FindObjectOfType <MoveControl>(); GameManager = FindObjectOfType <GameManager>(); blockValueText = GetComponentInChildren <TextMeshPro>(); SetValue(); }
// Use this for initialization void Start() { Main = gameObject.GetComponent <ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); AutoMove_Script = GameObject.Find("AutoMove").GetComponent <AutoMoveModule>(); AutoRunning_Script = gameObject.GetComponent <EntranceScript>(); Feedrate_height = Feedrate_width * 511 / 893; }
private void OnTriggerEnter2D(Collider2D collision) { MoveControl player = collision.gameObject.GetComponent <MoveControl>(); if (player != null) { player.ChangeHealth(-1); } }
/// <summary> /// Globally swap all MoveControl objects to have their "isRunning" flag disabled /// </summary> void DisableRunning() { object[] allObjects = Resources.FindObjectsOfTypeAll(typeof(MoveControl)); foreach (object thisObject in allObjects) { MoveControl tarObj = (MoveControl)thisObject; tarObj.isRunning = false; } }
void Awake() { _initLoc = img.anchoredPosition; _currLoc = _initLoc; instance = this; normalizedVec = Vector3.zero; SetToInitPosition(); }
// Use this for initialization void Start() { Main = gameObject.GetComponent <ControlPanel>(); CooSystem_script = gameObject.GetComponent <CooSystem>(); MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); // MDIEdit_Script = gameObject.GetComponent<MDIEditModule>(); HandWheel_script = GameObject.Find("KD").GetComponent <HandWheelModule>(); AutoRunning_Script = gameObject.GetComponent <EntranceScript>(); Softkey_Script = gameObject.GetComponent <SoftkeyModule>(); }
void Start() { enemyHpUI = GetComponent <EnemyHpUI>(); moveCtrl = GetComponent <MoveControl>(); enemyTr = GameObject.FindGameObjectWithTag("ENEMY").GetComponent <Transform>(); tr = GetComponent <Transform>(); layerMaskEnemy = LayerMask.NameToLayer("ENEMY"); gunLight = GetComponent <Light>(); }
void Start() { moveCtrl = GetComponent <MoveControl>(); tr = transform; enemyTr = GameObject.FindGameObjectWithTag("ENEMY").transform; enemylayer = LayerMask.NameToLayer("ENEMY"); ray = new Ray(); ray.origin = shootPos.position; ray.direction = shootPos.forward; }
// Use this for initialization void Start() { moveControl = GetComponent <MoveControl>(); weapon = GetComponent <Weapon>(); timeSense.gameObject.SetActive(false); Time.timeScale = 1; restart = false; health = healthTotal; ui.Lifebar = 1; ui.Cooldown = 1; timer = timerLimit; }
// Use this for initialization void Start() { // If a number of drones are not present (specified in editory) the cell should have max drones if (numDrones == 0) { numDrones = maxNumDrones; } // Initialize level script variables for easy access inputControl = GameObject.Find("Level Control").GetComponent <MoveControl>(); levelControl = GameObject.Find("Level Control").GetComponent <LevelControl>(); enemyControl = GameObject.Find("Level Control").GetComponent <EnemyControl>(); // Store reference to this cell's renderer thisRenderer = GetComponent <Renderer> (); // Update (initialize) faction info factionUpdate(faction); // Initialize cell highlight object for easy access highlightBlue = transform.Find("Highlight Blue").gameObject.GetComponent <MeshRenderer> (); highlightRed = transform.Find("Highlight Red").gameObject.GetComponent <MeshRenderer> (); // Use object scales to provide uniform highlight thickness among cells Vector3 h = highlightBlue.transform.localScale; h = new Vector3((highlightThickness / transform.localScale.x) + 1f, h.y, (highlightThickness / transform.localScale.z) + 1f); highlightBlue.transform.localScale = h; highlightRed.transform.localScale = h; // Drone move range is the defined ratio multiplied by the drone capacity droneRange = maxNumDrones * sizeToRangeRatio; // Initialize list of drones in cell droneList = transform.Find("Drone List"); // Mathematically generate drone position gameobjects at appropriate locations generateDronePositions(maxNumDrones); // Initialize array of drone position transforms droneArray = new Transform[droneList.childCount]; // Fill drone Array by displaying the drone mesh to indicate a drone in each appropriate position for (int i = 0; i < droneArray.Length; i++) { droneArray [i] = droneList.GetChild(i); if (i < numDrones) { droneArray [i].GetComponentInChildren <MeshRenderer> ().enabled = true; } } }
void Start() { StartGameCanvas.SetActive (true); PlayState = false; Time.timeScale = 0F; _otherScript = spawner.GetComponent<SpawnPlatforms>(); _moveScript = player.GetComponent<MoveControl>(); score = _otherScript.getCounter(); _moveScript.enabled = false; //number = score; }
void Start() { // print(Mathf.Asin(0.5F)); handWheelAreaRect = new Rect(handWheelPlaneRect); //Debug.Log(handWheelPoint); //Debug.Log(handWheelAreaRect); handWheelRadius = (handWheelPoint.x - handWheelOrigin.x) * (handWheelPoint.x - handWheelOrigin.x) + (handWheelPoint.y - handWheelOrigin.y) * (handWheelPoint.y - handWheelOrigin.y); handWheelRadius = Mathf.Pow(handWheelRadius, 0.5f); //Debug.Log(handWheelRadius); // minDistance=Mathf.Pow( handWheelRadius,0.5f)-15; // maxDistance=Mathf.Pow( handWheelRadius,0.5f)+15; MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); //MoveControl_script = Main.MoveControl_script; }
public void initCreatePlayer() { if (player != null) { Destroy(player); player = null; } GameObject baseain = Resources.Load <GameObject>("Entity/Player"); var baseMain = Instantiate(baseain); baseMain.name = "Player"; //player.transform.position = GameData.Data.LastBornPos; baseMain.transform.SetParent(CanvasLoad.instance.actor.transform); //待定 需要设置视图层级 player = baseMain; moveCtrl = baseMain.GetComponent <MoveControl>(); player.SetActive(true); initData(); }
// Start is called before the first frame update void Start() { Speed = Random.Range(SpeedMin, SpeedMax); if (Speed == 0) { Speed = 1; } Floow = true; FloowPoint = false; FloowPlayer = true; MainPlayer = GameObject.FindGameObjectWithTag("Player").transform; m_Transform = this.transform; moveControl = this.GetComponent <MoveControl>(); moveControl.Speed = Speed; }
// Use this for initialization void Start() { Main=GameObject.Find("MainScript").GetComponent<ControlPanel>(); //GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); //将变量与相应的组件对应起来 董帅 2013-5-9 Xp_part1=GameObject.Find("XYZ protecting crust_28").transform; Xp_part2=GameObject.Find("XYZ protecting crust_27").transform; Xp_part3=GameObject.Find("XYZ protecting crust_26").transform; Xp_part4=GameObject.Find("XYZ protecting crust_25").transform; Xn_part1=GameObject.Find("XYZ protecting crust_17").transform; Xn_part2=GameObject.Find("XYZ protecting crust_18").transform; Xn_part3=GameObject.Find("XYZ protecting crust_19").transform; Xn_part4=GameObject.Find("XYZ protecting crust_20").transform; Xp_zero1=Xp_part1.position.z; Xp_zero2=Xp_part2.position.z; Xp_zero3=Xp_part3.position.z; Xp_zero4=Xp_part4.position.z; Xn_zero1=Xn_part1.position.z; Xn_zero2=Xn_part2.position.z; Xn_zero3=Xn_part3.position.z; Xn_zero4=Xn_part4.position.z; //将变量与相应的组件对应起来 董帅 2013-5-9 Yn_part1=GameObject.Find("XYZ protecting crust_9").transform; Yn_part2=GameObject.Find("XYZ protecting crust_10").transform; Yn_part3=GameObject.Find("XYZ protecting crust_11").transform; Yn_zero1=Yn_part1.position.x; Yn_zero2=Yn_part2.position.x; Yn_zero3=Yn_part3.position.x; //将变量与相应的组件对应起来 董帅 2013-5-9 Zn_part1=GameObject.Find("XYZ protecting crust_6").transform; Zn_part2=GameObject.Find("XYZ protecting crust_5").transform; Zn_part3=GameObject.Find("XYZ protecting crust_4").transform; Zn_zero1=Zn_part1.position.y; Zn_zero2=Zn_part2.position.y; Zn_zero3=Zn_part3.position.y; }
// Use this for initialization void Start() { Main=GameObject.Find("MainScript").GetComponent<ControlPanel>(); GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); Xp_part1=GameObject.Find("X01_Y").transform; Xp_part2=GameObject.Find("X02_Y").transform; Xp_part3=GameObject.Find("X03_Y").transform; Xp_part4=GameObject.Find("X04_Y").transform; Xn_part1=GameObject.Find("X01_Z").transform; Xn_part2=GameObject.Find("X02_Z").transform; Xn_part3=GameObject.Find("X03_Z").transform; Xn_part4=GameObject.Find("X04_Z").transform; Xp_zero1=Xp_part1.position.z; Xp_zero2=Xp_part2.position.z; Xp_zero3=Xp_part3.position.z; Xp_zero4=Xp_part4.position.z; Xn_zero1=Xn_part1.position.z; Xn_zero2=Xn_part2.position.z; Xn_zero3=Xn_part3.position.z; Xn_zero4=Xn_part4.position.z; Yn_part1=GameObject.Find("Y01").transform; Yn_part2=GameObject.Find("Y02").transform; Yn_part3=GameObject.Find("Y03").transform; Yn_zero1=Yn_part1.position.x; Yn_zero2=Yn_part2.position.x; Yn_zero3=Yn_part3.position.x; Zn_part1=GameObject.Find("Z01").transform; Zn_part2=GameObject.Find("Z02").transform; Zn_part3=GameObject.Find("Z03").transform; Zn_zero1=Zn_part1.position.y; Zn_zero2=Zn_part2.position.y; Zn_zero3=Zn_part3.position.y; }
public float Z_distance; //Z轴移动方向上,主轴与铁片的y轴距离 // Use this for initialization void Start() { Main = GameObject.Find("MainScript").GetComponent <ControlPanel>(); GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent <MoveControl>(); Xp_part1 = GameObject.Find("X01_Y").transform; Xp_part2 = GameObject.Find("X02_Y").transform; Xp_part3 = GameObject.Find("X03_Y").transform; Xp_part4 = GameObject.Find("X04_Y").transform; Xn_part1 = GameObject.Find("X01_Z").transform; Xn_part2 = GameObject.Find("X02_Z").transform; Xn_part3 = GameObject.Find("X03_Z").transform; Xn_part4 = GameObject.Find("X04_Z").transform; Xp_zero1 = Xp_part1.position.z; Xp_zero2 = Xp_part2.position.z; Xp_zero3 = Xp_part3.position.z; Xp_zero4 = Xp_part4.position.z; Xn_zero1 = Xn_part1.position.z; Xn_zero2 = Xn_part2.position.z; Xn_zero3 = Xn_part3.position.z; Xn_zero4 = Xn_part4.position.z; Yn_part1 = GameObject.Find("Y01").transform; Yn_part2 = GameObject.Find("Y02").transform; Yn_part3 = GameObject.Find("Y03").transform; Yn_zero1 = Yn_part1.position.x; Yn_zero2 = Yn_part2.position.x; Yn_zero3 = Yn_part3.position.x; Zn_part1 = GameObject.Find("Z01").transform; Zn_part2 = GameObject.Find("Z02").transform; Zn_part3 = GameObject.Find("Z03").transform; Zn_zero1 = Zn_part1.position.y; Zn_zero2 = Zn_part2.position.y; Zn_zero3 = Zn_part3.position.y; }
protected override void UpdateBackState() { #region Action MoveControl.Move(MonitoringPoint.position); MoveControl.LookAt(MonitoringPoint.position); aniControlBoss.SpeedPercent = MoveControl.Magnitude / 2; #endregion #region Transtions float pointDistance = Distance(MonitoringPoint.position, transform.position); //Debug.Log("pointDistance: " + pointDistance); if (pointDistance <= RadiusMonitoringPoint) { // Chegou a ponto de origem // // radiusMonitoringPoint precisa ser igual ao navAgent.StoppingDistance // EnterState(TypeStateCharacter.Move); return; } #endregion }
public bool ChangeAutoManual(EnumAutoState state, ref string errorMessage) { EnumAutoState nowState = localData.AutoManual; if (state == nowState) { return(true); } switch (localData.AutoManual) { case EnumAutoState.Auto: if (localData.MoveControlData.MoveCommand != null) { MoveControl.VehicleStop(); } localData.AutoManual = EnumAutoState.Manual; return(true); case EnumAutoState.Manual: localData.AutoManual = EnumAutoState.PreAuto; if (localData.MoveControlData.MoveControlCanAuto) { localData.AutoManual = EnumAutoState.Auto; return(true); } else { localData.AutoManual = EnumAutoState.Manual; return(false); } case EnumAutoState.PreAuto: default: errorMessage = String.Concat("Auto/Manual 狀態目前為 PreAuto 因此Return false"); return(false); } }
// Use this for initialization void Start() { menu_rect.x = 100f; menu_rect.y = 300f; menu_rect.width = 300f; menu_rect.height = 180f; MoveControlScript = GameObject.Find("move_control").GetComponent <MoveControl>(); Main = GameObject.Find("MainScript").GetComponent <ControlPanel>(); //To be modified // MachineZeroPoint = new Vector3(-0.4093075f, -0.3187108f, 1.609089f); //相对坐标起点 MachineMaxPoint = new Vector3(0.3906925f, 0.1812892f, 2.119089f); //相对坐标终点 try { rotate_reference = GameObject.Find("GameObject").transform; } catch { Debug.LogError("Need to add more Empty GameObject by manually: Error caused by Eric Jiang."); return; } rotate_reference.name = "Rotate_Reference"; PathLineDraw_Script = GameObject.Find("Main Camera").GetComponent <PathLineDraw>(); }
void Awake() { gameObject.AddComponent("NCCodeFormat"); NCCodeFormat_Script=gameObject.GetComponent<NCCodeFormat>(); gameObject.AddComponent("PositionModule"); Position_Script = gameObject.GetComponent<PositionModule>(); gameObject.AddComponent("SystemModule");//添加脚本,姓名--刘旋,时间--2013-4-24 System_Script=gameObject.GetComponent<SystemModule>(); gameObject.AddComponent("MessageModule"); Message_Script=gameObject.GetComponent<MessageModule>(); gameObject.AddComponent("SoftkeyModule"); Softkey_Script = gameObject.GetComponent<SoftkeyModule>(); gameObject.AddComponent("ProgramModule"); Program_Script = gameObject.GetComponent<ProgramModule>(); gameObject.AddComponent("OffsetSettingModule"); Offset_Script = gameObject.GetComponent<OffsetSettingModule>(); gameObject.AddComponent("MDIInputModule"); MDIInput_Script = gameObject.GetComponent<MDIInputModule>(); gameObject.AddComponent("MDIFunctionModule"); MDIFunction_Script = gameObject.GetComponent<MDIFunctionModule>(); gameObject.AddComponent("MDIEditModule"); MDIEdit_Script = gameObject.GetComponent<MDIEditModule>(); gameObject.AddComponent("ModeSelectModule"); ModeSelect_Script = gameObject.GetComponent<ModeSelectModule>(); gameObject.AddComponent("FeedrateModule"); Feedrate_Script = gameObject.GetComponent<FeedrateModule>(); gameObject.AddComponent("MachineFunctionModule"); MachineFunction_Script = gameObject.GetComponent<MachineFunctionModule>(); gameObject.AddComponent("AuxiliaryFunctionModule"); AuxiliaryFunction_Script = gameObject.GetComponent<AuxiliaryFunctionModule>(); gameObject.AddComponent("AuxiliaryMoveModule"); AuxiliaryMove_Script = gameObject.GetComponent<AuxiliaryMoveModule>(); GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); GameObject.Find("spindle_control").AddComponent("SpindleControl"); SpindleControl_script = GameObject.Find("spindle_control").GetComponent<SpindleControl>(); gameObject.AddComponent("CooSystem"); gameObject.AddComponent("AutoMove"); gameObject.AddComponent("CompileNC"); CooSystem_script = gameObject.GetComponent<CooSystem>(); CompileNC_script = gameObject.GetComponent<CompileNC>(); t2d_lock = (Texture2D)Resources.Load("Texture_Panel/Button/lock"); t2d_unlock = (Texture2D)Resources.Load("Texture_Panel/Button/unlock"); t2d_alarm = (Texture2D)Resources.Load("Texture_Panel/Button/alarm"); t2d_zero = (Texture2D)Resources.Load("Texture_Panel/Button/zero"); t2d_toolnum = (Texture2D)Resources.Load("Texture_Panel/Button/toolnum"); t2d_em_u = (Texture2D)Resources.Load("Texture_Panel/Button/em_u"); t2d_em_d = (Texture2D)Resources.Load("Texture_Panel/Button/em_d"); t2d_Protect = t2d_lock; t2d_Emergency = t2d_em_u; t2d_ModeSelectEDIT = (Texture2D)Resources.Load("Texture_Panel/Button/mode_edit"); t2d_ModeSelectDNC = (Texture2D)Resources.Load("Texture_Panel/Button/mode_dnc"); t2d_ModeSelectAUTO = (Texture2D)Resources.Load("Texture_Panel/Button/mode_auto"); t2d_ModeSelectMDI = (Texture2D)Resources.Load("Texture_Panel/Button/mode_mdi"); t2d_ModeSelectHANDLE = (Texture2D)Resources.Load("Texture_Panel/Button/mode_handle"); t2d_ModeSelectJOG = (Texture2D)Resources.Load("Texture_Panel/Button/mode_jog"); t2d_ModeSelectREF = (Texture2D)Resources.Load("Texture_Panel/Button/mode_ref"); if(PlayerPrefs.HasKey("ModeSelect")) mode_type = PlayerPrefs.GetInt("ModeSelect"); else { PlayerPrefs.SetInt("ModeSelect", 1); mode_type = 1; } switch(mode_type) { case 1: t2d_ModeSelect = t2d_ModeSelectEDIT; MenuDisplay = "编辑"; ProgEDIT = true; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; editDisplay=true; break; case 2: t2d_ModeSelect = t2d_ModeSelectDNC; MenuDisplay = "DNC"; ProgEDIT = false; ProgDNC = true; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 3: t2d_ModeSelect = t2d_ModeSelectAUTO; MenuDisplay = "MEM"; ProgEDIT = false; ProgDNC = false; ProgAUTO = true; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 4: t2d_ModeSelect = t2d_ModeSelectMDI; MenuDisplay = "MDI"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = true; ProgHAN = false; ProgJOG = false; ProgREF = false; editDisplay=false; break; case 5: t2d_ModeSelect = t2d_ModeSelectHANDLE; MenuDisplay = "HAN"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = true; ProgJOG = false; ProgREF = false; break; case 6: t2d_ModeSelect = t2d_ModeSelectJOG; MenuDisplay = "JOG"; MoveControl_script.speed_to_move = 0.16667F;//内容--JOG模式下,慢常速为10m/min=(10/60)m/s,因此spee-to-move=10/60,姓名--刘旋,时间--2013-4-8 ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = true; ProgREF = false; break; case 7: t2d_ModeSelect = t2d_ModeSelectREF; MenuDisplay = "REF"; MoveControl_script.speed_to_move = 0.6F;//内容--归零操作的实际速度为5m/min=(5/60)m/s,而实际速度RunningSpeed=speed—to-move*move-rate,因此speed-to-move应设为5/60,姓名--刘旋,时间--2013-4-8 ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = true; break; } t2d_FeedRate_0 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate1"); t2d_FeedRate_10 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate2"); t2d_FeedRate_20 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate3"); t2d_FeedRate_30 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate4"); t2d_FeedRate_40 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate5"); t2d_FeedRate_50 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate6"); t2d_FeedRate_60 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate7"); t2d_FeedRate_70 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate8"); t2d_FeedRate_80 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate9"); t2d_FeedRate_90 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate10"); t2d_FeedRate_100 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate11"); t2d_FeedRate_110 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate12"); t2d_FeedRate_120 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate13"); t2d_FeedRate_130 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate14"); t2d_FeedRate_140 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate15"); t2d_FeedRate_150 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate16"); if(PlayerPrefs.HasKey("FeedrateSelect")) feedrate_type = PlayerPrefs.GetInt("FeedrateSelect"); else { PlayerPrefs.SetInt("FeedrateSelect", 11); feedrate_type = 11; } switch(feedrate_type) { case 1: t2d_feedrate = t2d_FeedRate_0; move_rate = 0f; break; case 2: t2d_feedrate = t2d_FeedRate_10; move_rate = 0.1f; break; case 3: t2d_feedrate = t2d_FeedRate_20; move_rate = 0.2f; break; case 4: t2d_feedrate = t2d_FeedRate_30; move_rate = 0.3f; break; case 5: t2d_feedrate = t2d_FeedRate_40; move_rate = 0.4f; break; case 6: t2d_feedrate = t2d_FeedRate_50; move_rate = 0.5f; break; case 7: t2d_feedrate = t2d_FeedRate_60; move_rate = 0.6f; break; case 8: t2d_feedrate = t2d_FeedRate_70; move_rate = 0.7f; break; case 9: t2d_feedrate = t2d_FeedRate_80; move_rate = 0.8f; break; case 10: t2d_feedrate = t2d_FeedRate_90; move_rate = 0.9f; break; case 11: t2d_feedrate = t2d_FeedRate_100; move_rate = 1.0f; break; case 12: t2d_feedrate = t2d_FeedRate_110; move_rate = 1.1f; break; case 13: t2d_feedrate = t2d_FeedRate_120; move_rate = 1.2f; break; case 14: t2d_feedrate = t2d_FeedRate_130; move_rate = 1.3f; break; case 15: t2d_feedrate = t2d_FeedRate_140; move_rate = 1.4f; break; case 16: t2d_feedrate = t2d_FeedRate_150; move_rate = 1.5f; break; } MoveControl_script.move_rate = move_rate; t2d_NCPower_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_u"); t2d_NCPower_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_d"); t2d_NCPower_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_u"); t2d_NCPower_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_d"); sty_NCPowerOn.normal.background = t2d_NCPower_on_u; sty_NCPowerOn.active.background = t2d_NCPower_on_d; sty_NCPowerOff.normal.background = t2d_NCPower_off_u; sty_NCPowerOff.active.background = t2d_NCPower_off_d; t2d_spCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_d"); t2d_spCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_u"); t2d_spCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_d"); t2d_spCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_u"); sty_ButtonCW.normal.background = t2d_spCW_off_u; sty_ButtonCW.active.background = t2d_spCW_off_d; t2d_spCCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_u"); t2d_spCCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_d"); t2d_spCCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_u"); t2d_spCCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_d"); sty_ButtonCCW.normal.background = t2d_spCCW_off_u; sty_ButtonCCW.active.background = t2d_spCCW_off_d; t2d_spStop_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_u"); t2d_spStop_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_d"); t2d_spStop_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_u"); t2d_spStop_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_d"); sty_ButtonSTOP.normal.background = t2d_spStop_on_u; sty_ButtonSTOP.active.background = t2d_spStop_on_d; t2d_rapid_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_u"); t2d_rapid_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_d"); t2d_rapid_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_u"); t2d_rapid_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_d"); sty_ButtonRapid.normal.background = t2d_rapid_off_u; sty_ButtonRapid.active.background = t2d_rapid_off_d; //内容--为变量赋值,用于实现JOG模式下F0,25%、50%、100%四个按钮的显示 //姓名--刘旋,时间--2013-4-8 t2d_f0_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f0_on_u"); t2d_f0_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f0_on_d"); t2d_f0_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f0_off_u"); t2d_f0_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f0_off_d"); sty_ButtonF0.normal.background=t2d_f0_off_u; sty_ButtonF0.active.background=t2d_f0_off_d; t2d_f25_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f25_on_u"); t2d_f25_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f25_on_d"); t2d_f25_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f25_off_u"); t2d_f25_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f25_off_d"); sty_ButtonF25.normal.background=t2d_f25_off_u; sty_ButtonF25.active.background=t2d_f25_off_d; t2d_f50_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f50_on_u"); t2d_f50_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f50_on_d"); t2d_f50_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f50_off_u"); t2d_f50_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f50_off_d"); sty_ButtonF50.normal.background=t2d_f50_off_u; sty_ButtonF50.active.background=t2d_f50_off_d; t2d_f100_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f100_on_u"); t2d_f100_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f100_on_d"); t2d_f100_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f100_off_u"); t2d_f100_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f100_off_d"); sty_ButtonF100.normal.background=t2d_f100_off_u; sty_ButtonF100.active.background=t2d_f100_off_d;//增加内容到此 2013-4-8 sty_ButtonYN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_off_u"); sty_ButtonYN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_on_d"); sty_ButtonYP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_off_u"); sty_ButtonYP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_on_d"); sty_ButtonZP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_off_u"); sty_ButtonZP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_on_d"); sty_ButtonZN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_off_u"); sty_ButtonZN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_on_d"); sty_ButtonXP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_off_u"); sty_ButtonXP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_on_d"); sty_ButtonXN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_off_u"); sty_ButtonXN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_on_d"); sty_Button4P.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_off_u"); sty_Button4P.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_on_d"); sty_Button4N.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_off_u"); sty_Button4N.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_on_d"); sty_ProgEDITWindowO.font = (Font)Resources.Load("font/STSONG"); sty_ProgEDITWindowO.fontSize = 16; sty_ProgEDITWindowO.normal.textColor = Color.white; sty_Title.font = (Font)Resources.Load("font/digifaw"); sty_Title.fontSize = 15; sty_TitleLetter.font = (Font)Resources.Load("font/STSONG"); sty_TitleLetter.fontSize = 17; sty_BigXYZ.font = (Font)Resources.Load("font/LCD"); sty_BigXYZ.fontSize = 45; sty_SmallNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_SmallNum.fontSize = 14; sty_ProgModeName.font = (Font)Resources.Load("font/times"); sty_ProgModeName.fontSize = 14; sty_Star.fontSize = 22; sty_Alarm.font = (Font)Resources.Load("font/times"); sty_Alarm.fontSize = 12; sty_Alarm.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/red"); sty_Alarm.normal.textColor = Color.white; sty_BottomChooseMenu.font = (Font)Resources.Load("font/monoMMM_5"); //sty_BottomChooseMenu.font = (Font)Resources.Load("font/times"); sty_BottomChooseMenu.fontSize = 14; sty_ProgEditProgNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEditProgNum.fontSize = 15; sty_ProgEditProgNum.normal.textColor = Color.white; sty_PosSmallWord.font = (Font)Resources.Load("font/simfang"); sty_PosSmallWord.fontSize = 15; sty_SmallXYZ.font = (Font)Resources.Load("font/times"); sty_SmallXYZ.fontSize = 17; sty_ScreenCover.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/StartScreen"); sty_ProgEDITWindowFG.font = (Font)Resources.Load("font/simfang"); sty_ProgEDITWindowFG.fontSize = 15; sty_ProgEDITWindowFG.normal.textColor = Color.white; sty_BottomAST.font = (Font)Resources.Load("font/times"); sty_BottomAST.fontSize = 15; //sty_BottomAST.normal.textColor = Color.cyan; sty_MostWords.font = (Font)Resources.Load("font/simfang"); sty_MostWords.fontSize = 15; //sty_MostWords.normal.textColor = Color.cyan; //sty_Code.font = (Font)Resources.Load("font/dutch"); sty_Code.fontSize = 17; sty_Code.fontStyle = FontStyle.Bold; sty_ModeCode.fontSize=15; sty_ModeCode.fontStyle=FontStyle.Bold; //内容--sty-Mode赋值为蓝色 //姓名--刘旋,时间--2013-3-29 sty_Mode.fontSize=15; sty_Mode.fontStyle=FontStyle.Bold; sty_Mode.normal.textColor=Color.blue; sty_ProgEDITListWindowNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEDITListWindowNum.fontSize = 13; sty_Cursor.font = (Font)Resources.Load("font/times"); sty_Cursor.fontSize = 15; sty_Warning.fontSize = 14; sty_Warning.normal.textColor = Color.red; sty_ScreenBackGround.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ScreenBackground"); sty_TopLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/toplabel"); sty_MessAlarm.font=(Font)Resources.Load("font/simfang"); sty_MessAlarm.normal.textColor=Color.red; sty_MessAlarm.fontSize=13; sty_MessRecordID.font=(Font)Resources.Load("font/simfang"); sty_MessRecordID.normal.textColor=Color.blue; sty_MessRecordID.fontSize=13; sty_MessRecordTime.font=(Font)Resources.Load("font/simfang"); sty_MessRecordTime.fontSize=14; sty_MessRecordInfo.font=(Font)Resources.Load("font/simfang"); sty_MessRecordInfo.fontSize=15; sty_SysID.font=(Font)Resources.Load("font/monoMMM_5"); sty_SysID.fontSize=13; sty_SysInfo.font=(Font)Resources.Load("font/simfang"); sty_SysInfo.fontSize=15; sty_SysInfo.normal.textColor=Color.blue; t2d_BottomButton_u = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); t2d_BottomButton_d = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButtonSmallest.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_smallest"); sty_BottomButton_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButton_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_5.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomLabel_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel01"); sty_BottomLabel_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel02"); sty_BottomLabel_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel03"); sty_BottomLabel_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel04"); sty_ClockStyle.fontSize = 14; sty_EDITLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EDITLabel"); sty_EDITLabelWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditWindow"); sty_EDITLabelBar_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar01"); sty_EDITLabelBar_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar02"); sty_EDITLabelBar_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar03"); sty_ProgSharedWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ProgSharedWindow"); sty_EDITCursor.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITCursor.fontSize = 17; sty_EDITCursor.fontStyle = FontStyle.Bold; sty_EDITTextField.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITTextField.normal.textColor = Color.yellow; sty_EDITTextField.fontSize = 17; sty_EDITTextField.fontStyle = FontStyle.Bold; sty_EDITList.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditList"); sty_InputTextField.font = (Font)Resources.Load("font/times"); sty_InputTextField.fontSize = 15; sty_OffSet_Coo.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo"); width = 670F; height = 650F; left = -700f; PanelWindowRect = new Rect(left, 30f, width, height); EDITText.enabled = false; EDITText.font = sty_Code.font; EDITText.fontSize = sty_Code.fontSize; //EDITText.fontStyle=FontStyle.Bold; EDITText.text = ""; ProgEDITCusorPos = 57f; CursorText.enabled = false; CursorText.font = sty_Cursor.font; CursorText.fontSize = sty_Cursor.fontSize; coo_setting_cursor_x = 131f; coo_setting_cursor_y = 120f; coo_setting_1 = 1; coo_setting_2 = 1; sty_SettingsBG.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/SettingsBG"); //设定界面修改---陈振华---03.11 sty_OffSet_Coo_mini.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mini"); sty_OffSet_Coo_mid.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mid"); //设定界面修改---陈振华---03.11 sty_EditListTop.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditListTop"); OffSetTool = true; OffSetSetting = false; OffSetCoo = false; //刀偏界面完善---张振华---03.30 sty_MostWords_ToolOffSet.font = (Font)Resources.Load("font/simfang"); sty_MostWords_ToolOffSet.fontSize = 13; ToolOffSetPage_num = 0; //页面数 number = 0; //序号 tool_setting = 1; //黄色背景序号 tool_setting_cursor_y = 81.5f; tool_setting_cursor_w = 91.5f; //刀偏界面完善---张振华---03.30 /*---------------------AUTO模式下测试数据-----------------------*/ CodeForAUTO.Add("O0001"); CodeForAUTO.Add(";"); CodeForAUTO.Add("G21"); CodeForAUTO.Add(";"); CodeForAUTO.Add("M06"); CodeForAUTO.Add("T01"); CodeForAUTO.Add(";"); CodeForAUTO.Add("G54"); CodeForAUTO.Add("G90"); CodeForAUTO.Add("G00"); CodeForAUTO.Add("X0."); CodeForAUTO.Add("Y0."); CodeForAUTO.Add("Z50."); CodeForAUTO.Add("Z51."); CodeForAUTO.Add("Z52."); CodeForAUTO.Add("Z53."); CodeForAUTO.Add("Z54."); CodeForAUTO.Add("Z55."); CodeForAUTO.Add("Z56."); CodeForAUTO.Add("Z57."); CodeForAUTO.Add("Z58."); CodeForAUTO.Add("Z59."); CodeForAUTO.Add("Z60."); CodeForAUTO.Add("Z61."); CodeForAUTO.Add("Z62."); CodeForAUTO.Add(";"); CodeForAUTO.Add("M3"); CodeForAUTO.Add("S800"); CodeForAUTO.Add(";"); CodeForAUTO.Add("M08"); CodeForAUTO.Add(";"); CodeForAUTO.Add("X0.646"); CodeForAUTO.Add("Y-8.648"); CodeForAUTO.Add(";"); CodeForAUTO.Add("G55"); CodeForAUTO.Add("S1000"); CodeForAUTO.Add(";"); CodeForAUTO.Add("G70"); CodeForAUTO.Add("X5.5"); CodeForAUTO.Add(";"); CodeForAUTO.Add("M3"); CodeForAUTO.Add(";"); SeparatePos = new int[100000]; AUTOSeparatePos=new int[100000]; //AutoDisplayFindRows(2,true); }
void Awake() { gameObject.AddComponent("PositionModule"); Position_Script = gameObject.GetComponent<PositionModule>(); gameObject.AddComponent("SoftkeyModule"); Softkey_Script = gameObject.GetComponent<SoftkeyModule>(); gameObject.AddComponent("ProgramModule"); Program_Script = gameObject.GetComponent<ProgramModule>(); gameObject.AddComponent("OffsetSettingModule"); Offset_Script = gameObject.GetComponent<OffsetSettingModule>(); gameObject.AddComponent("MDIInputModule"); MDIInput_Script = gameObject.GetComponent<MDIInputModule>(); gameObject.AddComponent("MDIFunctionModule"); MDIFunction_Script = gameObject.GetComponent<MDIFunctionModule>(); gameObject.AddComponent("MDIEditModule"); MDIEdit_Script = gameObject.GetComponent<MDIEditModule>(); gameObject.AddComponent("ModeSelectModule"); ModeSelect_Script = gameObject.GetComponent<ModeSelectModule>(); gameObject.AddComponent("FeedrateModule"); Feedrate_Script = gameObject.GetComponent<FeedrateModule>(); gameObject.AddComponent("MachineFunctionModule"); MachineFunction_Script = gameObject.GetComponent<MachineFunctionModule>(); gameObject.AddComponent("AuxiliaryFunctionModule"); AuxiliaryFunction_Script = gameObject.GetComponent<AuxiliaryFunctionModule>(); GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); GameObject.Find("spindle_control").AddComponent("SpindleControl"); SpindleControl_script = GameObject.Find("spindle_control").GetComponent<SpindleControl>(); gameObject.AddComponent("CooSystem"); gameObject.AddComponent("AutoMove"); gameObject.AddComponent("CompileNC"); CooSystem_script = gameObject.GetComponent<CooSystem>(); CompileNC_script = gameObject.GetComponent<CompileNC>(); t2d_lock = (Texture2D)Resources.Load("Texture_Panel/Button/lock"); t2d_unlock = (Texture2D)Resources.Load("Texture_Panel/Button/unlock"); t2d_alarm = (Texture2D)Resources.Load("Texture_Panel/Button/alarm"); t2d_zero = (Texture2D)Resources.Load("Texture_Panel/Button/zero"); t2d_toolnum = (Texture2D)Resources.Load("Texture_Panel/Button/toolnum"); t2d_em_u = (Texture2D)Resources.Load("Texture_Panel/Button/em_u"); t2d_em_d = (Texture2D)Resources.Load("Texture_Panel/Button/em_d"); t2d_Protect = t2d_lock; t2d_Emergency = t2d_em_u; t2d_ModeSelectEDIT = (Texture2D)Resources.Load("Texture_Panel/Button/mode_edit"); t2d_ModeSelectDNC = (Texture2D)Resources.Load("Texture_Panel/Button/mode_dnc"); t2d_ModeSelectAUTO = (Texture2D)Resources.Load("Texture_Panel/Button/mode_auto"); t2d_ModeSelectMDI = (Texture2D)Resources.Load("Texture_Panel/Button/mode_mdi"); t2d_ModeSelectHANDLE = (Texture2D)Resources.Load("Texture_Panel/Button/mode_handle"); t2d_ModeSelectJOG = (Texture2D)Resources.Load("Texture_Panel/Button/mode_jog"); t2d_ModeSelectREF = (Texture2D)Resources.Load("Texture_Panel/Button/mode_ref"); if(PlayerPrefs.HasKey("ModeSelect")) mode_type = PlayerPrefs.GetInt("ModeSelect"); else { PlayerPrefs.SetInt("ModeSelect", 1); mode_type = 1; } switch(mode_type) { case 1: t2d_ModeSelect = t2d_ModeSelectEDIT; MenuDisplay = "编辑"; ProgEDIT = true; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 2: t2d_ModeSelect = t2d_ModeSelectDNC; MenuDisplay = "DNC"; ProgEDIT = false; ProgDNC = true; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 3: t2d_ModeSelect = t2d_ModeSelectAUTO; MenuDisplay = "AUTO"; ProgEDIT = false; ProgDNC = false; ProgAUTO = true; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 4: t2d_ModeSelect = t2d_ModeSelectMDI; MenuDisplay = "MDI"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = true; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 5: t2d_ModeSelect = t2d_ModeSelectHANDLE; MenuDisplay = "HAN"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = true; ProgJOG = false; ProgREF = false; break; case 6: t2d_ModeSelect = t2d_ModeSelectJOG; MenuDisplay = "JOG"; MoveControl_script.speed_to_move = 0.10201F; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = true; ProgREF = false; break; case 7: t2d_ModeSelect = t2d_ModeSelectREF; MenuDisplay = "REF"; MoveControl_script.speed_to_move = 0.60201F; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = true; break; } t2d_FeedRate_0 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate1"); t2d_FeedRate_10 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate2"); t2d_FeedRate_20 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate3"); t2d_FeedRate_30 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate4"); t2d_FeedRate_40 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate5"); t2d_FeedRate_50 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate6"); t2d_FeedRate_60 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate7"); t2d_FeedRate_70 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate8"); t2d_FeedRate_80 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate9"); t2d_FeedRate_90 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate10"); t2d_FeedRate_100 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate11"); t2d_FeedRate_110 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate12"); t2d_FeedRate_120 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate13"); t2d_FeedRate_130 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate14"); t2d_FeedRate_140 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate15"); t2d_FeedRate_150 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate16"); if(PlayerPrefs.HasKey("FeedrateSelect")) feedrate_type = PlayerPrefs.GetInt("FeedrateSelect"); else { PlayerPrefs.SetInt("FeedrateSelect", 11); feedrate_type = 11; } switch(feedrate_type) { case 1: t2d_feedrate = t2d_FeedRate_0; move_rate = 0f; break; case 2: t2d_feedrate = t2d_FeedRate_10; move_rate = 0.1f; break; case 3: t2d_feedrate = t2d_FeedRate_20; move_rate = 0.2f; break; case 4: t2d_feedrate = t2d_FeedRate_30; move_rate = 0.3f; break; case 5: t2d_feedrate = t2d_FeedRate_40; move_rate = 0.4f; break; case 6: t2d_feedrate = t2d_FeedRate_50; move_rate = 0.5f; break; case 7: t2d_feedrate = t2d_FeedRate_60; move_rate = 0.6f; break; case 8: t2d_feedrate = t2d_FeedRate_70; move_rate = 0.7f; break; case 9: t2d_feedrate = t2d_FeedRate_80; move_rate = 0.8f; break; case 10: t2d_feedrate = t2d_FeedRate_90; move_rate = 0.9f; break; case 11: t2d_feedrate = t2d_FeedRate_100; move_rate = 1.0f; break; case 12: t2d_feedrate = t2d_FeedRate_110; move_rate = 1.1f; break; case 13: t2d_feedrate = t2d_FeedRate_120; move_rate = 1.2f; break; case 14: t2d_feedrate = t2d_FeedRate_130; move_rate = 1.3f; break; case 15: t2d_feedrate = t2d_FeedRate_140; move_rate = 1.4f; break; case 16: t2d_feedrate = t2d_FeedRate_150; move_rate = 1.5f; break; } MoveControl_script.move_rate = move_rate; t2d_NCPower_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_u"); t2d_NCPower_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_d"); t2d_NCPower_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_u"); t2d_NCPower_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_d"); sty_NCPowerOn.normal.background = t2d_NCPower_on_u; sty_NCPowerOn.active.background = t2d_NCPower_on_d; sty_NCPowerOff.normal.background = t2d_NCPower_off_u; sty_NCPowerOff.active.background = t2d_NCPower_off_d; t2d_spCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_d"); t2d_spCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_u"); t2d_spCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_d"); t2d_spCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_u"); sty_ButtonCW.normal.background = t2d_spCW_off_u; sty_ButtonCW.active.background = t2d_spCW_off_d; t2d_spCCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_u"); t2d_spCCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_d"); t2d_spCCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_u"); t2d_spCCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_d"); sty_ButtonCCW.normal.background = t2d_spCCW_off_u; sty_ButtonCCW.active.background = t2d_spCCW_off_d; t2d_spStop_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_u"); t2d_spStop_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_d"); t2d_spStop_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_u"); t2d_spStop_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_d"); sty_ButtonSTOP.normal.background = t2d_spStop_on_u; sty_ButtonSTOP.active.background = t2d_spStop_on_d; t2d_rapid_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_u"); t2d_rapid_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_d"); t2d_rapid_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_u"); t2d_rapid_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_d"); sty_ButtonRapid.normal.background = t2d_rapid_off_u; sty_ButtonRapid.active.background = t2d_rapid_off_d; sty_ButtonYN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_off_u"); sty_ButtonYN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_on_d"); sty_ButtonYP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_off_u"); sty_ButtonYP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_on_d"); sty_ButtonZP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_off_u"); sty_ButtonZP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_on_d"); sty_ButtonZN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_off_u"); sty_ButtonZN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_on_d"); sty_ButtonXP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_off_u"); sty_ButtonXP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_on_d"); sty_ButtonXN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_off_u"); sty_ButtonXN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_on_d"); sty_Button4P.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_off_u"); sty_Button4P.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_on_d"); sty_Button4N.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_off_u"); sty_Button4N.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_on_d"); sty_ProgEDITWindowO.font = (Font)Resources.Load("font/STSONG"); sty_ProgEDITWindowO.fontSize = 16; sty_ProgEDITWindowO.normal.textColor = Color.white; sty_Title.font = (Font)Resources.Load("font/digifaw"); sty_Title.fontSize = 15; sty_TitleLetter.font = (Font)Resources.Load("font/STSONG"); sty_TitleLetter.fontSize = 17; sty_BigXYZ.font = (Font)Resources.Load("font/LCD"); sty_BigXYZ.fontSize = 45; sty_SmallNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_SmallNum.fontSize = 14; sty_ProgModeName.font = (Font)Resources.Load("font/times"); sty_ProgModeName.fontSize = 14; sty_Star.fontSize = 22; sty_Alarm.font = (Font)Resources.Load("font/times"); sty_Alarm.fontSize = 12; sty_Alarm.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/red"); sty_Alarm.normal.textColor = Color.white; sty_BottomChooseMenu.font = (Font)Resources.Load("font/monoMMM_5"); sty_BottomChooseMenu.fontSize = 14; sty_ProgEditProgNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEditProgNum.fontSize = 15; sty_ProgEditProgNum.normal.textColor = Color.white; sty_PosSmallWord.font = (Font)Resources.Load("font/simfang"); sty_PosSmallWord.fontSize = 15; sty_SmallXYZ.font = (Font)Resources.Load("font/times"); sty_SmallXYZ.fontSize = 17; sty_ScreenCover.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/StartScreen"); sty_ProgEDITWindowFG.font = (Font)Resources.Load("font/simfang"); sty_ProgEDITWindowFG.fontSize = 15; sty_ProgEDITWindowFG.normal.textColor = Color.white; sty_BottomAST.font = (Font)Resources.Load("font/times"); sty_BottomAST.fontSize = 15; //sty_BottomAST.normal.textColor = Color.cyan; sty_MostWords.font = (Font)Resources.Load("font/simfang"); sty_MostWords.fontSize = 15; //sty_MostWords.normal.textColor = Color.cyan; //刀偏界面字体设置 sty_MostWords_ToolOffSet.font = (Font)Resources.Load("font/simfang"); sty_MostWords_ToolOffSet.fontSize = 13; //刀偏界面字体设置 sty_Code.fontSize = 17; sty_Code.fontStyle = FontStyle.Bold; sty_ProgEDITListWindowNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEDITListWindowNum.fontSize = 13; sty_Cursor.font = (Font)Resources.Load("font/times"); sty_Cursor.fontSize = 15; sty_Warning.fontSize = 14; sty_Warning.normal.textColor = Color.red; sty_ScreenBackGround.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ScreenBackground"); sty_TopLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/toplabel"); t2d_BottomButton_u = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); t2d_BottomButton_d = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButtonSmallest.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_smallest"); sty_BottomButton_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButton_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_5.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomLabel_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel01"); sty_BottomLabel_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel02"); sty_BottomLabel_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel03"); sty_BottomLabel_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel04"); sty_ClockStyle.fontSize = 14; sty_EDITLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EDITLabel"); sty_EDITLabelWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditWindow"); sty_EDITLabelBar_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar01"); sty_EDITLabelBar_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar02"); sty_EDITLabelBar_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar03"); sty_ProgSharedWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ProgSharedWindow"); sty_EDITCursor.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITTextField.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITTextField.normal.textColor = Color.yellow; sty_EDITTextField.fontSize = 17; sty_EDITTextField.fontStyle = FontStyle.Bold; sty_EDITList.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditList"); sty_InputTextField.font = (Font)Resources.Load("font/times"); sty_InputTextField.fontSize = 15; sty_OffSet_Coo.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo"); sty_OffSet_Coo_mini.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mini"); sty_OffSet_Coo_mid.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mid"); width = 670F; height = 650F; PanelWindowRect = new Rect(0,0,width,height); EDITText.enabled = false; EDITText.font = sty_Code.font; EDITText.fontSize = sty_Code.fontSize; EDITText.fontStyle=FontStyle.Bold; EDITText.text = ""; ProgEDITCusorPos = 57f; CursorText.enabled = false; CursorText.font = sty_Cursor.font; CursorText.fontSize = sty_Cursor.fontSize; coo_setting_cursor_x = 131f; coo_setting_cursor_y = 120f; coo_setting_1 = 1; coo_setting_2 = 1; sty_SettingsBG.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/SettingsBG"); //设定界面 //argu_setting_cursor_x = 240f; argu_setting_cursor_y = 61.5f; argu_setting_cursor_w = 16f; argu_setting = 1; //设定界面 //刀偏界面 ToolOffSetPage_num = 0; //页面数 number = 0; //序号 tool_setting = 1; //黄色背景序号 tool_setting_cursor_y = 81.5f; tool_setting_cursor_w = 91.5f; //刀偏界面 }
private void Awake() { MoveControl = FindObjectOfType <MoveControl>(); GameManager = FindObjectOfType <GameManager>(); UIManager = FindObjectOfType <UIManager>(); }
// Use this for initialization void Start() { ControlPanel_script = gameObject.GetComponent<ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); ReadCooFile(); workpiece_coo = G54_pos; workpiece_flag = 1; //设定界面修改---陈振华---03.11 parameter = PlayerPrefs.GetString("parameter"); TV = PlayerPrefs.GetString("TV"); CKJC = PlayerPrefs.GetString("CKJC"); input_unit = PlayerPrefs.GetString("input_unit"); IO = PlayerPrefs.GetString("IO"); order = PlayerPrefs.GetString("order"); zhidai = PlayerPrefs.GetString("zhidai"); order_stop1 = PlayerPrefs.GetString("order_stop1"); order_stop2 = PlayerPrefs.GetString("order_stop2"); }
// Use this for initialization void Start() { Main = gameObject.GetComponent<ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); ReadCooFile(); workpiece_coo = G54_pos; workpiece_flag = 1; //获得设置界面显示值 if(PlayerPrefs.HasKey("parameter_writabel")) parameter_writabel = PlayerPrefs.GetString("parameter_writabel"); else { PlayerPrefs.SetString("parameter_writabel", "1"); parameter_writabel = "1"; } if(PlayerPrefs.HasKey("TV_check")) TV_check = PlayerPrefs.GetString("TV_check"); else { PlayerPrefs.SetString("TV_check", "0"); TV_check = "0"; } if(PlayerPrefs.HasKey("hole_code")) hole_code = PlayerPrefs.GetString("hole_code"); else { PlayerPrefs.SetString("hole_code", "1"); hole_code = "1"; } if(PlayerPrefs.HasKey("input_unit")) input_unit = PlayerPrefs.GetString("input_unit"); else { PlayerPrefs.SetString("input_unit", "0"); input_unit = "0"; } if(PlayerPrefs.HasKey("IO")) IO = PlayerPrefs.GetString("IO"); else { PlayerPrefs.SetString("IO", "0"); IO = "0"; } if(PlayerPrefs.HasKey("sequence_number")) sequence_number = PlayerPrefs.GetString("sequence_number"); else { PlayerPrefs.SetString("sequence_number", "0"); sequence_number = "0"; } if(PlayerPrefs.HasKey("paper_tape")) paper_tape = PlayerPrefs.GetString("paper_tape"); else { PlayerPrefs.SetString("paper_tape", "0"); paper_tape = "0"; } if(PlayerPrefs.HasKey("SN_stop1")) SN_stop1 = PlayerPrefs.GetString("SN_stop1"); else { PlayerPrefs.SetString("SN_stop1", "0"); SN_stop1 = "0"; } if(PlayerPrefs.HasKey("SN_stop2")) SN_stop2 = PlayerPrefs.GetString("SN_stop2"); else { PlayerPrefs.SetString("SN_stop2", "0"); SN_stop2 = "0"; } //获得设置界面显示值 ReadToolFile (); }
void Start() { CooSystem_script = gameObject.GetComponent<CooSystem>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); }
//位置界面功能完善---宋荣 ---03.09 // Use this for initialization void Start() { Main = gameObject.GetComponent<ControlPanel>(); CooSystem_script = gameObject.GetComponent<CooSystem>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); //位置界面功能完善---宋荣 ---03.09 MDIInput_script=gameObject.GetComponent<MDIInputModule>(); //位置界面功能完善---宋荣 ---03.09 }
// Use this for initialization void Start() { ControlPanel_script = gameObject.GetComponent<ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); ReadCooFile(); workpiece_coo = G54_pos; workpiece_flag = 1; }
// Use this for initialization void Start() { ControlPanel_script = gameObject.GetComponent<ControlPanel>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); ReadCooFile(); workpiece_coo = G54_pos; workpiece_flag = 1; //刀偏界面数值读取 ReadToolFile (); //获得设置界面显示值 if(PlayerPrefs.HasKey("parameter")) parameter = PlayerPrefs.GetString("parameter"); else PlayerPrefs.SetString("parameter", "0"); if(PlayerPrefs.HasKey("TV")) TV = PlayerPrefs.GetString("TV"); else PlayerPrefs.SetString("TV", "0"); if(PlayerPrefs.HasKey("CKJC")) CKJC = PlayerPrefs.GetString("CKJC"); else PlayerPrefs.SetString("CKJC", "0"); if(PlayerPrefs.HasKey("input_unit")) input_unit = PlayerPrefs.GetString("input_unit"); else PlayerPrefs.SetString("input_unit", "0"); if(PlayerPrefs.HasKey("IO")) IO = PlayerPrefs.GetString("IO"); else PlayerPrefs.SetString("IO", "0"); if(PlayerPrefs.HasKey("order")) order = PlayerPrefs.GetString("order"); else PlayerPrefs.SetString("order", "0"); if(PlayerPrefs.HasKey("zhidai")) zhidai = PlayerPrefs.GetString("zhidai"); else PlayerPrefs.SetString("zhidai", "0"); if(PlayerPrefs.HasKey("order_stop1")) order_stop1 = PlayerPrefs.GetString("order_stop1"); else PlayerPrefs.SetString("order_stop1", "0"); if(PlayerPrefs.HasKey("order_stop2")) order_stop2 = PlayerPrefs.GetString("order_stop2"); else PlayerPrefs.SetString("order_stop2", "0"); //获得设置界面显示值 }
protected override void InitController() { _move = new MoveControl(this); }
// Use this for initialization void Start() { Main = gameObject.GetComponent<ControlPanel>(); CooSystem_script = gameObject.GetComponent<CooSystem>(); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); CompileNC_script = gameObject.GetComponent<CompileNC>(); }
// Use this for initialization void Start() { MoveControlScript = GameObject.Find("move_control").GetComponent<MoveControl>(); rotate_ref = GameObject.Find("rotate_ref").transform; round_dot_transform = GameObject.Find("zero").transform; move_sound = (AudioClip)Resources.Load("Audio/move"); }