public static PhysicFlyAction GetSSAction(float x) { PhysicFlyAction action = ScriptableObject.CreateInstance <PhysicFlyAction>(); action.speedX = x; return(action); }
public static PhysicFlyAction getAction(Vector3 direction, float speed) { PhysicFlyAction action = CreateInstance <PhysicFlyAction>(); action.direction = direction; action.speed = speed; return(action); }
protected new void Start() { sceneController = Director.getInstance().currentSceneController as FirstSceneController; sceneController.ufoActionManager = this; slowFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), slowSpeed); middleFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), middleSpeed); fastFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), fastSpeed); }
public void FlyUFO(GameObject ufo, int round) { if (round == 1) { slowFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), slowSpeed); this.RunAction(ufo, slowFlyAction, this); } else if (round == 2) { middleFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), middleSpeed); this.RunAction(ufo, middleFlyAction, this); } else if (round == 3) { fastFlyAction = PhysicFlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), fastSpeed); this.RunAction(ufo, fastFlyAction, this); } }
public override void MoveDisk(GameObject disk) { action = PhysicFlyAction.GetSSAction(disk.GetComponent <DiskAttributes>().speedX); RunAction(disk, action, this); }