Beispiel #1
0
    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;
    }
Beispiel #2
0
 public static void Recycle(UIEventListenerContext context)
 {
     RecyclableObject.Recycle(context);
 }