Ejemplo n.º 1
0
    ///<description>Spawn Plane with these parametes</description>
    public Plane SpawnPlane(PlaneSOData planeSOData, APlaneContoller planeContoller, Transform spawnPosRot)
    {
        Plane plane = GetNextUnusedPooledObject();

        plane.InitPlane(planeSOData, planeContoller, spawnPosRot);
        return(plane);
    }
Ejemplo n.º 2
0
    public override void InitPlane(PlaneSOData PlaneData, APlaneContoller PlaneContoller, Transform spawnPosRot = null)
    {
        enemyPlane = ((AIPlaneController)PlaneContoller).GetRandomEnemyPlane();
        if (enemyPlane == null)
        {
            DisablePlane();
        }

        base.InitPlane(PlaneData, PlaneContoller, spawnPosRot);
        activateTime = Time.time;
    }
Ejemplo n.º 3
0
 public virtual void InitPlane(PlaneSOData planeData, APlaneContoller PlaneContoller, Transform spawnPosRot = null)
 {
     ResetParams();
     EnablePlane();
     this.planeData      = planeData;
     this.planeContoller = PlaneContoller;
     transform.name      = planeData.planeName;
     healthModel.InitParams(this, planeData.maxHealth, OnPlaneDeath);
     planeSprite.color = planeData.planeColor;
     if (spawnPosRot != null)
     {
         transform.position = spawnPosRot.position;
         transform.rotation = spawnPosRot.rotation;
     }
 }