Beispiel #1
0
    public void UFOFly(DiskModel disk)
    {
        ruler.setRound(round);
        disk.disk.transform.position = ruler.getStart();//设置飞碟的出现位置
        int index = 0;

        for (; diskID[index] != -1; index++)
        {
            ;                                 //找到空闲的 Action
        }
        actions[index] = FlyAction.GetSSAction(ruler.getAngle(), ruler.getSpeed());
        diskID[index]  = disk.getDiskID();
        this.RunAction(disk.disk, actions[index], this);
    }
Beispiel #2
0
    public void UFOFly(DiskModel disk)
    {
        ruler.setRound(round);
        disk.disk.transform.position = ruler.getStart();//设置飞碟的出现位置
        int index = 0;

        for (; diskID[index] != -1; index++)
        {
            ;                                 //找到空闲的 Action
        }
        actions[index] = FlyAction.GetSSAction(ruler.getAngle(), ruler.getSpeed());
        diskID[index]  = disk.getDiskID();
        disk.disk.GetComponent <Rigidbody>().useGravity = false;
        disk.disk.GetComponent <Rigidbody>().velocity   = Vector3.zero;
        this.RunAction(disk.disk, actions[index], this);
    }
Beispiel #3
0
    public void runActionByRound(int round)
    {
        sumNum = round;
        isLose = false;
        GameObject disk;

        for (int i = 0; i < round; i += 2)
        {
            disk = dic.setDiskOnPos(leftEmitPos);

            FlyAction fly = FlyAction.GetSSAction(new Vector3(Random.Range(5f, 15), Random.Range(2.5f, 5), Random.Range(0, 0.75f)));
            this.runAction(disk, fly, this);
        }

        for (int i = 1; i < round; i += 2)
        {
            disk = dic.setDiskOnPos(rightRmitPos);

            FlyAction fly = FlyAction.GetSSAction(new Vector3(Random.Range(-15f, -5f), Random.Range(2.5f, 5), Random.Range(0, 0.75f)));
            this.runAction(disk, fly, this);
        }
        // 设置飞碟发射,发射round个飞碟
    }
 //飞碟飞行
 public void UFOFly(GameObject disk, float angle, float power)
 {
     fly = FlyAction.GetSSAction(disk.GetComponent <DiskData>().direction, angle, power);
     this.RunAction(disk, fly, this);
 }
Beispiel #5
0
 // Update is called once per frame
 public void Fly(GameObject role_, Vector3 emitPosition_, Vector3 emitDirection_)
 {
     fly = FlyAction.GetSSAction(role_, emitPosition_, emitDirection_);
     this.RunAction(role_, fly, this);
 }
 public void flyUFO(GameObject disk, Vector3 target, float speed)
 {
     UFOAction = FlyAction.GetSSAction(target, speed);
     this.RunAction(disk, UFOAction, this);
 }