public void playDisk() { moveDisk = Move.GetSSAction(); Disk = diskFactory.getDisk(sceneController.GetRound()); this.RunAction(Disk, moveDisk, this); Disk.GetComponent <DiskData>().action = moveDisk; }
public void playDisk(int round) { EmitDisk = PhysicsEmit.GetSSAction(); Disk = diskFactory.getDisk(round); this.AddAction(Disk, EmitDisk, this); Disk.GetComponent <DiskControl>().action = EmitDisk; }
public void playDisk() { EmitDisk = Emit2.GetSSAction(); Disk = diskFactory.getDisk(sceneController.round); this.RunAction(Disk, EmitDisk, this); Disk.GetComponent <DiskData2>().action = EmitDisk; }
public void playDisk(int round) { //Debug.Log(diskFactory); EmitDisk = Emit.GetSSAction(); Disk = diskFactory.getDisk(round); this.AddAction(Disk, EmitDisk, this); Disk.GetComponent <DiskControl>().action = EmitDisk; }
private void sendOneDisk(int sendLever) { numOfDiskAlredySend++; diskInfo oneDisk = diskFac.getDisk(sendLever, ifPhysicManager); diskMove moveAction = diskMove.getDiskMove(oneDisk, sendLever, ifPhysicManager); actionManager.RunAction(oneDisk.disk, moveAction, null); }
//发送飞碟 private void sendDisk() { diskCount++; DiskModel disk = diskFactory.getDisk(); //从工厂获取新的飞碟 currentDisks.Add(disk); //将新飞碟加入到当前的列表 actionManager.UFOFly(disk); //令飞碟进行移动 }
public void playDisk() { // Debug.Log("this"); EmitDisk = Emit.GetSSAction(); Disk = diskFactory.getDisk(sceneController.GetRound()); this.RunAction(Disk, EmitDisk, this); Disk.GetComponent <DiskData>().action = EmitDisk; }
// Use this for initialization void Start() { disk = DiskFactory.getDisk(); if (disk.onClick()) { addScore(); free(disk); } }
private void nextRound() { DiskFactory diskFactory = Singleton <DiskFactory> .Instance; for (int i = 0; i < diskNumber; i++) { diskQueue.Enqueue(diskFactory.getDisk(currentRound, actionMode)); } actionManager.startThrow(diskQueue); }
public void getDisksForNextRound() { DiskFactory diskFactory = Singleton <DiskFactory> .Instance; int numDisk = 10; for (int i = 0; i < numDisk; i++) { GameObject disk = diskFactory.getDisk(round); disksQueue.Enqueue(disk); } }
public void emitDisk() { for (int i = 0; i < disk_level.getEmitnum(); i++) { int id = myFactory.getDisk(); GameObject disk = myFactory.GetDiskObject(id); disk.SetActive(true); ActionManager.GetInstance().ApplyMoveToAction(disk); disk.GetComponent <MoveToAction>().setId(id); } }
public void emitDisk(int diskNumer, Color c, int speed) { for (int i = 0; i < diskNumer; ++i) { GameObject temp = DF.getDisk(); temp.transform.position = mainCamera.transform.position; temp.GetComponent <Rigidbody> ().velocity = new Vector3(0, Random.Range(0.5f, 1) * 10, Random.Range(0.5f, 1) * 10); temp.GetComponent <Renderer> ().material.color = c; alreadyEmited.Add(temp); } }
public void randomAction(int ufoNum, int level) { setColor(level); for (int i = 0; i < ufoNum; i++) { Vector3 position = new Vector3(0, 0, -20f); float speed = level * 10f;//飞碟速度 Vector3 force = new Vector3( UnityEngine.Random.Range(-5f, 5f), UnityEngine.Random.Range(10f, 12f), speed); Ruler ruler = new Ruler(color, position, 0, Vector3.zero); //新建一个规则 diskList.Add(diskFactory.getDisk(force, ruler)); //添加飞碟 } }
public void emitDisk(int diskNumer, Color c, int speed) { for (int i = 0; i < diskNumer; ++i) { GameObject temp = DF.getDisk(); temp.transform.position = mainCamera.transform.position; temp.GetComponent <Renderer> ().material.color = c; alreadyEmited.Add(temp); physics.emitDisk(new GameObject[1] { temp }, speed); // or use kinact to support movement of disks // kinact.emitDisk(temp, speed); } }
// Update is called once per frame protected new void Update() { if (sceneController.round <= 3 && sceneController.game == 1) { count++; if (count == 60) { EmitDisk = Emit2.GetSSAction(); this.RunAction(diskFactory.getDisk(sceneController.round), EmitDisk, this); sceneController.num++; print(sceneController.num); count = 0; } base.Update(); } }
//投掷飞盘 public void playDisk() { // Debug.Log("this"); EmitDisk = Emit.GetSSAction(); //从工厂中获取飞盘 try { Disk = diskFactory.getDisk(sceneController.GetRound()); } catch (System.Exception e) { Debug.Log("get disk failed"); } //添加动作进管理器 this.RunAction(Disk, EmitDisk, this); Disk.GetComponent <DiskData>().action = EmitDisk; }
public void randomAction(int ufoNum, int level) { setColor(level); for (int i = 0; i < ufoNum; i++) { Vector3 position = new Vector3(0, 0, 0); //飞碟的起始位置 float speed = level * 10f; //飞碟速度 Vector3 direction = new Vector3( UnityEngine.Random.Range(-10f, 10f), UnityEngine.Random.Range(40f, 80f), UnityEngine.Random.Range(50f, 100f)); //飞碟方向 direction.Normalize(); //单位化该方向向量,以免产生较大误差 Ruler ruler = new Ruler(color, position, speed, direction); //新建一个规则 diskList.Add(diskFactory.getDisk(ruler)); //添加飞碟 } }
void Update() { interval += Time.deltaTime; if (interval >= 1f && director.state == State.PLAYING && level > 0)//若间隔大于1s且处于play且已设置好level { for (int i = 0; i < ufoNum; i++) { Vector3 position = new Vector3(0, 0, 0); //飞碟的起始位置 speed = level * 20f; //飞碟速度 Vector3 direction = new Vector3( UnityEngine.Random.Range(-10f, 10f), UnityEngine.Random.Range(0, 80f), UnityEngine.Random.Range(50f, 100f)); //飞碟方向 direction.Normalize(); //单位化该方向向量,以免产生较大误差 Ruler ruler = new Ruler(color, position, speed, direction); //新建一个规则 diskList.Add(diskFactory.getDisk(ruler)); //添加飞碟 } interval = 0;//间隔重新置为0 } for (int i = 0; i < diskList.Count; i++) { move(diskList[i]);//移动飞碟 } if (Input.GetButtonDown("Fire1"))//开火 { Vector3 mousePosition = Input.mousePosition; Camera cam = Camera.main; Ray ray = cam.ScreenPointToRay(mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { score.record(level); //计分 recycle(hit.transform.gameObject.GetComponent <DiskData>()); //回收 } } for (int i = 0; i < diskList.Count; i++) { if (diskList[i].gameObject.transform.position.y < 0)//若飞碟低于地面,则回收 { recycle(diskList[i]); } } }
// Update is called once per frame void Update() //manage game state /** * 游戏进入下一轮,增加轮数,同时重置飞碟数重置,分数不重置 */ { Debug.Log("ROUND " + gameRound + " DIskThrow" + numberOfDisksThrown); if (numberOfDisksThrown == numberOfDisks && gameState == 1) { gameRound = (gameRound + 1) % (totalRound + 1); throwPeriod = (totalRound + 1 - gameRound) / 2; //从游戏工厂中获得一定数目的飞碟放入飞碟队列 DiskFactory df = Singleton <DiskFactory> .Instance; for (int i = 0; i < numberOfDisks; i++) { disks.Enqueue(df.getDisk(gameRound)); } //将每个动作挂在到disks链表的每个元素上面 actionManager.startThrow(disks); numberOfDisksThrown = 0; } if (gameRound == 0) //初始化 { gameState = 0; numberOfDisksThrown = numberOfDisks; } /** *判断飞碟扔出的时间间隔 */ if (gameState == 1) { if (timeInterval > throwPeriod) { randomThrow(); timeInterval = 0; } else { timeInterval += Time.deltaTime; } } }
void Update() { currentTimeCount++; if (startShot) { if (currentTimeCount % timeCountPerSec == 0 && cur_n < n) { cur_n++; if (cur_n == n) { stopShotDisk(); return; } else { disk_factory.getDisk(roundCount); } } } }
public void LoadResources() { disk_queue.Enqueue(disk_factory.getDisk(round)); }
public void FlyOneDisk() { DiskData disk = diskFactory.getDisk(ruler); disk.fly(); }