Пример #1
0
    public static string GetAgentBodyTypeURL(AgentBodyType type)
    {
        string bodyURL;

        switch (type)
        {
        case AgentBodyType.AbsWheelA:
            bodyURL = "Prefabs/AgentPrefabs/AgentAbsWheelA";
            break;

        case AgentBodyType.BipedA:
            bodyURL = "Prefabs/AgentPrefabs/AgentBipedA";
            break;

        case AgentBodyType.CombatBotA:
            bodyURL = "Prefabs/AgentPrefabs/AgentCombatBotA";
            break;

        case AgentBodyType.DogCarA:
            bodyURL = "Prefabs/AgentPrefabs/AgentDogCarA";
            break;

        case AgentBodyType.GroundRollerA:
            bodyURL = "Prefabs/AgentPrefabs/AgentGroundRollerA";
            break;

        case AgentBodyType.GroundRollerB:
            bodyURL = "Prefabs/AgentPrefabs/AgentGroundRollerB";
            break;

        case AgentBodyType.HexapodA:
            bodyURL = "Prefabs/AgentPrefabs/AgentHexapodA";
            break;

        case AgentBodyType.HoverBotA:
            bodyURL = "Prefabs/AgentPrefabs/AgentHoverBotA";
            break;

        case AgentBodyType.HoverBotB:
            bodyURL = "Prefabs/AgentPrefabs/AgentHoverBotB";
            break;

        case AgentBodyType.PistonWalkerA:
            bodyURL = "Prefabs/AgentPrefabs/AgentPistonWalkerA";
            break;

        case AgentBodyType.QuadrapedA:
            bodyURL = "Prefabs/AgentPrefabs/AgentQuadrapedA";
            break;

        case AgentBodyType.QuadrapedB:
            bodyURL = "Prefabs/AgentPrefabs/AgentQuadrapedB";
            break;

        case AgentBodyType.QuadrapedC:
            bodyURL = "Prefabs/AgentPrefabs/AgentQuadrapedC";
            break;

        case AgentBodyType.SlapperTurtleA:
            bodyURL = "Prefabs/AgentPrefabs/AgentSlapperTurtleA";
            break;

        case AgentBodyType.SnakeA:
            bodyURL = "Prefabs/AgentPrefabs/AgentSnakeA";
            break;

        case AgentBodyType.SphereA:
            bodyURL = "Prefabs/AgentPrefabs/AgentSphereA";
            break;

        case AgentBodyType.SphereShipA:
            bodyURL = "Prefabs/AgentPrefabs/AgentSphereShipA";
            break;

        case AgentBodyType.TelevisionWalkerA:
            bodyURL = "Prefabs/AgentPrefabs/AgentTelevisionWalkerA";
            break;

        case AgentBodyType.TelevisionWalkerB:
            bodyURL = "Prefabs/AgentPrefabs/AgentTelevisionWalkerB";
            break;

        case AgentBodyType.TripodA:
            bodyURL = "Prefabs/AgentPrefabs/AgentTripodA";
            break;

        case AgentBodyType.UnicycleA:
            bodyURL = "Prefabs/AgentPrefabs/AgentUnicycleA";
            break;

        default:
            bodyURL = "";
            Debug.LogError("NO BODYURL FOUND");
            break;
        }
        return(bodyURL);
    }
Пример #2
0
    public void CopyBodyGenomeFromTemplate(BodyGenome templateGenome)
    {
        // This method creates a clone of the provided BodyGenome - should have no shared references!!!

        bodyType = templateGenome.bodyType;
        // copy module lists:
        atmosphereSensorList = new List <AtmosphereSensorGenome>();
        for (int i = 0; i < templateGenome.atmosphereSensorList.Count; i++)
        {
            AtmosphereSensorGenome genomeCopy = new AtmosphereSensorGenome(templateGenome.atmosphereSensorList[i]);
            atmosphereSensorList.Add(genomeCopy);
        }
        basicJointList = new List <BasicJointGenome>();
        for (int i = 0; i < templateGenome.basicJointList.Count; i++)
        {
            BasicJointGenome genomeCopy = new BasicJointGenome(templateGenome.basicJointList[i]);
            basicJointList.Add(genomeCopy);
        }
        basicWheelList = new List <BasicWheelGenome>();
        for (int i = 0; i < templateGenome.basicWheelList.Count; i++)
        {
            BasicWheelGenome genomeCopy = new BasicWheelGenome(templateGenome.basicWheelList[i]);
            basicWheelList.Add(genomeCopy);
        }
        contactSensorList = new List <ContactGenome>();
        for (int i = 0; i < templateGenome.contactSensorList.Count; i++)
        {
            ContactGenome genomeCopy = new ContactGenome(templateGenome.contactSensorList[i]);
            contactSensorList.Add(genomeCopy);
        }
        gravitySensorList = new List <GravitySensorGenome>();
        for (int i = 0; i < templateGenome.gravitySensorList.Count; i++)
        {
            GravitySensorGenome genomeCopy = new GravitySensorGenome(templateGenome.gravitySensorList[i]);
            gravitySensorList.Add(genomeCopy);
        }
        healthModuleList = new List <HealthGenome>();
        for (int i = 0; i < templateGenome.healthModuleList.Count; i++)
        {
            HealthGenome genomeCopy = new HealthGenome(templateGenome.healthModuleList[i]);
            healthModuleList.Add(genomeCopy);
        }
        oscillatorInputList = new List <OscillatorGenome>();
        for (int i = 0; i < templateGenome.oscillatorInputList.Count; i++)
        {
            OscillatorGenome genomeCopy = new OscillatorGenome(templateGenome.oscillatorInputList[i]);
            oscillatorInputList.Add(genomeCopy);
        }
        raycastSensorList = new List <RaycastSensorGenome>();
        for (int i = 0; i < templateGenome.raycastSensorList.Count; i++)
        {
            RaycastSensorGenome genomeCopy = new RaycastSensorGenome(templateGenome.raycastSensorList[i]);
            raycastSensorList.Add(genomeCopy);
        }
        shieldList = new List <ShieldGenome>();
        for (int i = 0; i < templateGenome.shieldList.Count; i++)
        {
            ShieldGenome genomeCopy = new ShieldGenome(templateGenome.shieldList[i]);
            shieldList.Add(genomeCopy);
        }
        targetSensorList = new List <TargetSensorGenome>();
        for (int i = 0; i < templateGenome.targetSensorList.Count; i++)
        {
            TargetSensorGenome genomeCopy = new TargetSensorGenome(templateGenome.targetSensorList[i]);
            targetSensorList.Add(genomeCopy);
        }
        thrusterList = new List <ThrusterGenome>();
        for (int i = 0; i < templateGenome.thrusterList.Count; i++)
        {
            ThrusterGenome genomeCopy = new ThrusterGenome(templateGenome.thrusterList[i]);
            thrusterList.Add(genomeCopy);
        }
        torqueList = new List <TorqueGenome>();
        for (int i = 0; i < templateGenome.torqueList.Count; i++)
        {
            TorqueGenome genomeCopy = new TorqueGenome(templateGenome.torqueList[i]);
            torqueList.Add(genomeCopy);
        }
        trajectorySensorList = new List <TrajectorySensorGenome>();
        for (int i = 0; i < templateGenome.trajectorySensorList.Count; i++)
        {
            TrajectorySensorGenome genomeCopy = new TrajectorySensorGenome(templateGenome.trajectorySensorList[i]);
            trajectorySensorList.Add(genomeCopy);
        }
        valueInputList = new List <ValueInputGenome>();
        for (int i = 0; i < templateGenome.valueInputList.Count; i++)
        {
            ValueInputGenome genomeCopy = new ValueInputGenome(templateGenome.valueInputList[i]);
            valueInputList.Add(genomeCopy);
        }
        weaponProjectileList = new List <WeaponProjectileGenome>();
        for (int i = 0; i < templateGenome.weaponProjectileList.Count; i++)
        {
            WeaponProjectileGenome genomeCopy = new WeaponProjectileGenome(templateGenome.weaponProjectileList[i]);
            weaponProjectileList.Add(genomeCopy);
        }
        weaponTazerList = new List <WeaponTazerGenome>();
        for (int i = 0; i < templateGenome.weaponTazerList.Count; i++)
        {
            WeaponTazerGenome genomeCopy = new WeaponTazerGenome(templateGenome.weaponTazerList[i]);
            weaponTazerList.Add(genomeCopy);
        }
    }