Esempio n. 1
0
    public static PhysicFlyAction GetSSAction(float x)
    {
        PhysicFlyAction action = ScriptableObject.CreateInstance <PhysicFlyAction>();

        action.speedX = x;
        return(action);
    }
Esempio n. 2
0
    public static PhysicFlyAction getAction(Vector3 direction, float speed)
    {
        PhysicFlyAction action = CreateInstance <PhysicFlyAction>();

        action.direction = direction;
        action.speed     = speed;
        return(action);
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
 public override void MoveDisk(GameObject disk)
 {
     action = PhysicFlyAction.GetSSAction(disk.GetComponent <DiskAttributes>().speedX);
     RunAction(disk, action, this);
 }