Esempio n. 1
0
 protected new void Start()
 {
     sceneController = Director.getInstance().currentSceneController as FirstSceneController;
     sceneController.ufoActionManager = this;
     slowFlyAction   = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), slowSpeed);
     middleFlyAction = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), middleSpeed);
     fastFlyAction   = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), fastSpeed);
 }
Esempio n. 2
0
 public void ActionEvent(Action source, GameObject gameObjectParam = null, ActionEventType events = ActionEventType.Compeleted,
                         int intParam = 0, string strParam = null)
 {
     if (events == ActionEventType.Started)
     {
         slowFlyAction   = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), slowSpeed);
         middleFlyAction = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), middleSpeed);
         fastFlyAction   = FlyAction.getAction(new Vector3(Random.Range(-1, 1f), Random.Range(-1, 1f)), fastSpeed);
         this.RunAction(gameObjectParam, source, this);
     }
     else if (events == ActionEventType.Compeleted)
     {
         UFOFactory ufofactory = Singleton <UFOFactory> .Instance;
         ufofactory.freeUFO(gameObjectParam);
     }
 }