public void SetTankType(TankType tankType) { ObjectType objectType = ObjectType.Tank_Green; mTankAttack.Damage = 25f; switch (tankType) { case TankType.Blue: mTankAttack.Damage = 20f; objectType = ObjectType.Tank_Blue; break; case TankType.Red: mTankAttack.Damage = 10f; objectType = ObjectType.Tank_Red; break; } if (mTankModel != null) { mTankModel.Recycle(); } mTankModel = ObjectPool.Instance.GetRecyclableObject(objectType); mTankModel.Spawn(transform.position, transform.rotation, transform); mTankRigidbody.isKinematic = false; }
public static void Recycle(UIEventListenerContext context) { RecyclableObject.Recycle(context); }