public void DiskFly(GameObject disk, float angle, float power) { int direction = (disk.transform.position.x > 0) ? -1 : 1; flyAction = DiskFlyAction.GetSSAction(direction, angle, power); this.RunAction(disk, flyAction, this); }
public static DiskFlyAction GetSSAction(float angle, float power) //Vector3 direction, float angle, float power) { //初始化物体将要运动的初速度向量 DiskFlyAction action = CreateInstance <DiskFlyAction>(); action.start_vector = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * power; return(action); }
public void DiskFly(GameObject disk, float angle, float speed) { int leftOrRight = 1;//from left is 1, from right is -1 if (disk.transform.position.x > 0) { leftOrRight = -1; } fly = DiskFlyAction.GetSSAction(leftOrRight, angle, speed); this.StartAction(disk, fly); }
//飞碟飞行 public void DiskFly(GameObject disk, float angle, float power) { int lor = 1; if (disk.transform.position.x > 0) { lor = -1; } fly = DiskFlyAction.GetSSAction(lor, angle, power); this.RunAction(disk, fly, this); }
//飞碟飞行 public void DiskFly(GameObject disk, float angle, float power) { disk.GetComponent <Rigidbody>().isKinematic = true; int lor = 1; if (disk.transform.position.x > 0) { lor = -1; } fly = DiskFlyAction.GetSSAction(lor, angle, power); this.RunAction(disk, fly, this); }
public static DiskFlyAction GetSSAction(int direction, float angle, float speed) { DiskFlyAction action = ScriptableObject.CreateInstance <DiskFlyAction>(); if (direction == -1) { action.speed = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * speed; } else { action.speed = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * speed; } return(action); }
public static DiskFlyAction GetSSAction(Vector3 direction, float angle, float power) { DiskFlyAction action = CreateInstance <DiskFlyAction>(); if (direction.x == -1) { action.start_vector = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * power; } else { action.start_vector = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * power; } return(action); }
public static DiskFlyAction GetSSAction(int lor, float angle, float speed) { DiskFlyAction action = CreateInstance <DiskFlyAction>(); if (lor == -1) { action.start_velocity = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * speed; } else { action.start_velocity = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * speed; } return(action); }
public static DiskFlyAction GetSSAction(int lor, float angle, float power) { //初始化物体将要运动的初速度向量 DiskFlyAction action = CreateInstance <DiskFlyAction>(); if (lor == -1) { action.start_vector = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * power; } else { action.start_vector = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * power; } return(action); }
public void DiskFly(GameObject disk, int mode, mes information) { int leftOrRight = 1;//from left is 1, from right is -1 if (disk.transform.position.x > 0) { leftOrRight = -1; } if (mode == 2) { fly = DiskFlyAction.GetSSAction(leftOrRight, information.angle, information.speed); this.StartAction(disk, fly); } else { fly_ = PhysisFlyAction.GetSSAction(leftOrRight, information.speed); this.StartAction(disk, fly_); } }
public static DiskFlyAction GetSSAction(Vector3 direction, float angle, float power, bool flag) { Vector3 delta_vector = new Vector3(0, -3, 0); DiskFlyAction action = CreateInstance <DiskFlyAction>(); if (flag) { action.start_vector += delta_vector; } else { if (direction.x == -1) { action.start_vector = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * power; } else { action.start_vector = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * power; } } return(action); }
//飞行 public void UFOFly(GameObject disk, float angle, float power, bool flag) { fly = DiskFlyAction.GetSSAction(disk.GetComponent <DiskComponent>().direction, angle, power, flag); this.RunAction(disk, fly, this); }
//飞碟飞行 public void diskFly(GameObject disk, float angle, float power) { fly = DiskFlyAction.GetSSAction(angle, power); this.RunAction(disk, fly, this); }
public void DiskFly(GameObject disk, float angle, float power) { fly = DiskFlyAction.GetSSAction(disk.GetComponent <DiskData>().direction, angle, power); this.RunAction(disk, fly, this); }