Ejemplo n.º 1
0
    public static Action getAction(int score, float _speed)
    {
        ThrowUFO action = ScriptableObject.CreateInstance <ThrowUFO>();

        action.factory    = Factory_UFO.getInstance();
        action.ufo        = action.factory.getProduct();
        action.speed      = _speed;
        action.ufo.Score  = score;
        action.ufo.canHit = true;
        action.gameobject = action.ufo.gameobject;
        return(action);
    }
Ejemplo n.º 2
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("UFO") == true)
     {
         int id  = collision.gameObject.GetInstanceID();
         UFO ufo = Factory_UFO.getInstance().getProduct(id);
         if (ufo.canHit)
         {
             Scorer.getInstance().addScore(ufo.Score);
         }
     }
 }