///<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); }
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; }
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; } }