示例#1
0
 void changeObject()
 {
     currentType++;
     if (currentType == Vehicle.vehicleType.Base)
     {
         currentType = Vehicle.vehicleType.Tank;
     }
     currentVehicle = GetVehicleByType(currentType);
     Debug.Log("Changed object to id:" + currentType + ", name:" + currentVehicle.vehicleObject.name);
 }
示例#2
0
 Vehicle GetVehicleByType(Vehicle.vehicleType type)
 {
     foreach (Vehicle v in GameLogic.Instance.vehicleTypes)
     {
         if (type == v.type)
         {
             return(v);
         }
     }
     return(null);
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        aiMovementMode       = moveMode.Command;
        agent.updatePosition = false;
        agent.updateRotation = false;

        vehicleType = controller.vehicle.type;
        switch (vehicleType)
        {
        case Vehicle.vehicleType.Tank:
            attackController = GetComponentInChildren <TankTurretControl>();
            break;

        case Vehicle.vehicleType.Truck:
            break;

        case Vehicle.vehicleType.Heli:
            break;

        case Vehicle.vehicleType.Spy:
            break;

        case Vehicle.vehicleType.Base:
            break;

        default:
            attackController = GetComponentInChildren <WeaponControl>();
            break;
        }

        Vehicle v = GetComponent <VehicleController>().vehicle;

        attackRange = v.attackRange;
        sightRange  = v.sightRange;

        oldPos = transform.position;
    }
示例#4
0
    public Vehicle SummonVehicle(GameObject prefab, Vector3 position, Quaternion rotation, Vehicle.vehicleType type, Vehicle.vehicleSide side = Vehicle.vehicleSide.Player)
    {
        GameObject newVehicleObj = (GameObject)Instantiate(prefab, position, rotation);
        Vehicle    vehicle       = new Vehicle(newVehicleObj, type, side);

        newVehicleObj.GetComponent <VehicleController>().vehicle = vehicle;
        vehicles.Add(vehicle);
        Debug.Log("added " + vehicle.vehicleObject.name);
        return(vehicle);
    }
示例#5
0
 void Start()
 {
     currentType    = Vehicle.vehicleType.Tank;
     currentVehicle = GetVehicleByType(currentType);
 }