public static PhysisUFOFlyAction GetSSAction(Vector3 direction, float angle, float power) { //初始化物体将要运动的初速度向量 PhysisUFOFlyAction action = CreateInstance <PhysisUFOFlyAction>(); 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; } action.power = power; return(action); }
//飞碟飞行 public void UFOFly(GameObject disk, float angle, float power) { fly = PhysisUFOFlyAction.GetSSAction(disk.GetComponent <DiskData>().direction, angle, power); this.RunAction(disk, fly, this); }