public void SetIsStopMoveCar(bool isStop)
    {
        //Debug.Log("Unity:"+"SetIsStopMoveCar -> isStop "+isStop);
        if (IsStopMoveCar == isStop)
        {
            return;
        }

        IsStopMoveCar = isStop;
        m_Driving     = !isStop;
        if (CarMoveCom == null)
        {
            CarMoveCom = GetComponent <XKCarMoveCtrl>();
        }

        if (WaypointCom == null)
        {
            WaypointCom = GetComponent <WaypointProgressTracker>();
        }

        if (!isStop)
        {
            CarMoveCom.StartMoveCar();
            m_Target = WaypointCom.target;
            WaypointCom.Reset();
        }
        else
        {
            CarMoveCom.StopMoveCar();
        }
    }
Esempio n. 2
0
 void Awake()
 {
     Destroyed          = false;
     CarProgressTracker = GetComponent <WaypointProgressTracker>();
     triggerLastTime    = -1000;
     DamageMade         = Money;
 }
Esempio n. 3
0
    /// <summary>
    /// Спавним ботов
    /// </summary>
    private void SpawBots()
    {
        int numberBot = 0;

        while (IsCanSpawnBot(numberBot))
        {
            if (pathsContainer.Paths.Count == 0)
            {
                return;
            }

            Transform startPoint   = CheckPosition();
            Transform transformBot = Instantiate(prefabBot, startPoint.position, startPoint.rotation, parentCar);
            string    nameDriver   = NameBot();
            transformBot.name = "Enemy_" + nameDriver;
            transformBot.GetComponent <DriverName>().Driver_Name = nameDriver;

            SpawnWaypointCircuit(nameDriver);
            WaypointProgressTracker newWaypointProgressTracker = transformBot.GetComponent <WaypointProgressTracker>();
            newWaypointProgressTracker.circuit = newWaypointCircuit;
            newWaypointProgressTracker.Reset();

            Color newBotColor = CheckColor();
            AddColorBot(newBotColor, transformBot);

            ViewName viewName = Instantiate(prefabUi, Vector3.one * 1000, Quaternion.identity, parentUi);
            viewName.name = "ViewName_" + nameDriver;
            viewName.Init(transformBot, newBotColor, nameDriver);

            numberBot++;
        }
    }
Esempio n. 4
0
 private void OnTriggerEnter(Collider other)
 {
     progresstracker = car.GetComponent <WaypointProgressTracker>();
     carControl      = car.GetComponent <CarAIControl>();
     //progresstracker.gameObject.SetActive(false);
     //carControl.gameObject.SetActive(false);
     car.AddComponent <CirclingMotion>();
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     ready    = GetComponent <Text>();
     shoot    = FindObjectOfType <Shooting>();
     waypoint = FindObjectOfType <WaypointProgressTracker>();
     count    = 0;
     changeText();
 }
Esempio n. 6
0
    /// <summary>
    /// Function Called when the object is activated for the first time. Used for initializations
    /// </summary>
    void Awake()
    {
        myWpPrTrk       = transform.GetComponent <WaypointProgressTracker>();
        usedWaypoint    = ((GameObject)Instantiate(baseWaypointCircuit, transform.position + Vector3.up * wpHeight, Quaternion.identity)).GetComponent <WaypointCircuit>();
        usedSinglePoint = ((GameObject)Instantiate(singlePointObject, transform.position + Vector3.up * wpHeight, Quaternion.identity)).GetComponent <singlePoint>();

        myWpPrTrk.setWaypoint(usedSinglePoint);
        actualDotsQty = usedWaypoint.transform.childCount;
    }
 void Start()
 {
     _st              = gameObject.GetComponent <Stats>();
     _mc              = gameObject.GetComponent <MoveComponent>();
     _WPT             = gameObject.GetComponent <WaypointProgressTracker>();
     _h               = gameObject.GetComponent <HealthModule>();
     _as              = gameObject.GetComponent <ActiveState>();
     TypeChangerTimer = 0;
 }
Esempio n. 8
0
 private void LoadPrefabs()
 {
     obstacles        = new GameObject("Obstacles");
     pillarPrefab     = Resources.Load <Transform>("Pillar");
     checkPointPrefab = Resources.Load <CheckPoint>("CheckPoint");
     carPrefab        = Resources.Load <WaypointProgressTracker>("Car");
     characterPrefab  = Resources.Load("Character");
     ramps.Add(Resources.Load <Transform>("MiniRamp"));
     ramps.Add(Resources.Load <Transform>("Ramp"));
 }
    void Start()
    {
        my_ai      = GetComponent <CarAIControl>();
        my_control = GetComponent <CarUserControl>();
        my_pause   = GetComponent <pause_controller_s>();
        my_wpt     = GetComponent <WaypointProgressTracker>();

        Update_Lap_Display();
        SetComponents();
    }
Esempio n. 10
0
 void Start()
 {
     car              = GetComponent <CarController>();
     car_state        = GetComponent <csCarState>();
     ai               = GetComponent <CarAIControl>();
     tracker          = GetComponent <WaypointProgressTracker>();
     Original_Destroy = GameObject.Find("Original_Target_Setting").GetComponent <csDestroy_Original>();
     Ranking          = GameObject.Find("Directional Light").GetComponent <csRanking>();
     GameTimer        = GameObject.Find("Directional Light").GetComponent <csGameTimer>();
 }
 public void CopyFrom(WaypointProgressTracker other)
 {
     circuit = other.circuit;
     progressDistance = other.progressDistance;
     progressNum = other.progressNum;
     if (progressStyle == ProgressStyle.PointToPoint)
     {
         target.position = circuit.Waypoints[progressNum].position;
         target.rotation = circuit.Waypoints[progressNum].rotation;
     }
 }
Esempio n. 12
0
    // This method spawns each enemy wave for the teams
    // Sends data to each minion playerstats script
    void SpawnMinion(WaveData wave)
    {
        AIEntity minionEntity = ServerEntitySpawner.instance.SpawnMinion(wave.m_entityIdentifier, wave.m_position.position, transform.rotation);

        waypointScript         = minionEntity.GetComponent <WaypointProgressTracker>();
        minionScript           = minionEntity.GetComponent <AIEntity>();
        waypointScript.circuit = circuitScript;
        minionEntity.name      = wave.m_entityIdentifier + waveNumber.ToString();
        (minionScript.EntityLogic as MinionWaveLogic).XOffset = wave.m_position.position.x;
        waveNumber++;
    }
Esempio n. 13
0
        public void rightLaneChange()
        {
            WaypointProgressTracker customPT    = transform.GetComponentInParent <WaypointProgressTracker>();
            ConnectedWaypoints      z           = customPT.circuit.transform.GetComponentInParent <ConnectedWaypoints>();
            WaypointCircuit         nextCircuit = z.GetRightCircuit();

            if (nextCircuit != null)
            {
                customPT.circuit = nextCircuit;
            }
        }
Esempio n. 14
0
        private void activateLaneChange()
        {
            WaypointProgressTracker customPT    = transform.GetComponentInParent <WaypointProgressTracker>();
            ConnectedWaypoints      z           = customPT.circuit.transform.GetComponentInParent <ConnectedWaypoints>();
            WaypointCircuit         nextCircuit = z.GetAdjacentCircuit();

            if (nextCircuit != null)
            {
                customPT.circuit = nextCircuit;
            }
        }
Esempio n. 15
0
        // Use this for initialization
        void Start()
        {
            if (_autoStart)
            {
                _moving = true;
            }

            _rigidBody        = GetComponent <Rigidbody>();
            _wayPointProgress = GetComponentInChildren <WaypointProgressTracker>();
            _targetPos        = _wayPointProgress.target.position;
        }
Esempio n. 16
0
 void Start()
 {
     ai               = GetComponent <CarAIControl>();
     CollCheck        = GetComponent <csCollisionCheck>();
     car              = GetComponent <CarController>();
     childBody        = gameObject.transform.FindChild("Image").gameObject;
     car_body         = gameObject.transform.FindChild("Body").gameObject;
     Big_Jump_Target  = GameObject.Find("Big_Jump_Area").transform.FindChild("Big_Jump_Point");
     Big_Jump_Target1 = GameObject.Find("Big_Jump_Area").transform.FindChild("Big_Jump_Point1");
     tracker          = GetComponent <WaypointProgressTracker>();
     StartCoroutine(JumperTrigger());
 }
Esempio n. 17
0
    ///

    void Start()
    {
        GooglePlayGames.PlayGamesPlatform.Activate();

        P1_Button_Text.text = UserManager.Instance().name;

        GameFIN = GameObject.Find("Directional Light").GetComponent <csGameFINISH>();

        P1_Name.text = UserManager.Instance().name;

        Player1_traker = GameObject.Find("MyPlayer").GetComponent <WaypointProgressTracker>();
        Player2_traker = GameObject.Find("Computer1").GetComponent <WaypointProgressTracker>();
        Player3_traker = GameObject.Find("Computer2").GetComponent <WaypointProgressTracker>();
        Player4_traker = GameObject.Find("Computer3").GetComponent <WaypointProgressTracker>();

        Player1_CollCheck = GameObject.Find("MyPlayer").GetComponent <csCollisionCheck>();
        Player2_CollCheck = GameObject.Find("Computer1").GetComponent <csCollisionCheck>();
        Player3_CollCheck = GameObject.Find("Computer2").GetComponent <csCollisionCheck>();
        Player4_CollCheck = GameObject.Find("Computer3").GetComponent <csCollisionCheck>();

        P1_Car_State = GameObject.Find("MyPlayer").GetComponent <csCarState>();
        P2_Car_State = GameObject.Find("Computer1").GetComponent <csCarState>();
        P3_Car_State = GameObject.Find("Computer2").GetComponent <csCarState>();
        P4_Car_State = GameObject.Find("Computer3").GetComponent <csCarState>();

        P1_Carcontroller = GameObject.Find("MyPlayer").GetComponent <CarController>();
        P2_Carcontroller = GameObject.Find("Computer1").GetComponent <CarController>();
        P3_Carcontroller = GameObject.Find("Computer2").GetComponent <CarController>();
        P4_Carcontroller = GameObject.Find("Computer3").GetComponent <CarController>();

        P1_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P1_Speed1_0x = P1_Car_State.maxSpeed * 1.2f;
        P1_Speed1_1x = P1_Car_State.maxSpeed * 1.5f;
        P1_Speed1_2x = P1_Car_State.maxSpeed * 2.0f;

        P2_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P2_Speed1_0x = P2_Car_State.maxSpeed * 1.2f;
        P2_Speed1_1x = P2_Car_State.maxSpeed * 1.5f;
        P2_Speed1_2x = P2_Car_State.maxSpeed * 2.0f;

        P3_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P3_Speed1_0x = P3_Car_State.maxSpeed * 1.2f;
        P3_Speed1_1x = P3_Car_State.maxSpeed * 1.5f;
        P3_Speed1_2x = P3_Car_State.maxSpeed * 2.0f;

        P4_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P4_Speed1_0x = P4_Car_State.maxSpeed * 1.2f;
        P4_Speed1_1x = P4_Car_State.maxSpeed * 1.5f;
        P4_Speed1_2x = P4_Car_State.maxSpeed * 2.0f;
    }
Esempio n. 18
0
 public void InitializeCircuit()
 {
     if (m_waypointTracker == null)
     {
         m_waypointTracker = gameObject.AddComponent <WaypointProgressTracker>();
     }
     if (m_entity.Team == ETeam.Blue)
     {
         m_waypointTracker.circuit = MinionSpawnManager.m_blueCircuitScript;
     }
     else
     {
         m_waypointTracker.circuit = MinionSpawnManager.m_redCirtcuitScript;
     }
     m_waypointTracker.Reset();
 }
Esempio n. 19
0
    void Start()
    {
        animator = GetComponent <Animator>();

        playerStatScript = GetComponent <PlayerStats>();

        waypointsScript = GetComponent <WaypointProgressTracker>();

        initialPos = transform.position;

        if (uLink.Network.isServer)
        {
            agent = GetComponentInChildren <NavMeshAgent>();
            agent.updateRotation = false;
            agent.updatePosition = true;
        }
    }
Esempio n. 20
0
    void Update()
    {
        Debug.Log(getFirstCarOnRace());
        foreach (CarController car in _carContainer.GetComponentsInChildren <CarController>(true))
        {
            float counter;
            counter = _carPositions[car].lap * 1000 + _carPositions[car].checkPoint * 100;
            if (car.GetComponent <WaypointProgressTracker>() != null)
            {
                WaypointProgressTracker wp = car.GetComponent <WaypointProgressTracker>();
                counter += wp.GetProgressDistance();
                _carPositions[car].progress = counter;
            }
            else
            {
                if (_carPositions[car].target == null)
                {
                    _carPositions[car].target = new GameObject(name + " Waypoint Target").transform;
                }

                Vector3 targetDelta = _carPositions[car].target.position - car.transform.position;
                if (targetDelta.magnitude < 20)
                {
                    _carPositions[car].progressNum = (_carPositions[car].progressNum + 1) % circuit.Waypoints.Length;
                }

                _carPositions[car].target.position = circuit.Waypoints[_carPositions[car].progressNum].position;
                _carPositions[car].target.rotation = circuit.Waypoints[_carPositions[car].progressNum].rotation;


                _carPositions[car].progressPoint = circuit.GetRoutePoint(_carPositions[car].progressDistance);
                Vector3 progressDelta = _carPositions[car].progressPoint.position - car.transform.position;
                if (Vector3.Dot(progressDelta, _carPositions[car].progressPoint.direction) < 0)
                {
                    _carPositions[car].progressDistance += progressDelta.magnitude;
                }
                counter += _carPositions[car].progressDistance;
                _carPositions[car].progress = +counter;
            }
        }
    }
Esempio n. 21
0
    private void Start()
    {
        audioSource             = GetComponent <AudioSource>();
        keyValet                = FindObjectOfType <KeyValet>();
        playerHandler           = FindObjectOfType <PlayerHandler>();
        waypointProgressTracker = FindObjectOfType <WaypointProgressTracker>();

        debugMode = Debug.isDebugBuild;

        invulnerableKey = keyValet.GetKey("PlayerController-ToggleInvulnerable");
        maxEnergyKey    = keyValet.GetKey("PlayerController-ToggleEnergyMax");
        shieldKey       = keyValet.GetKey("PlayerController-ShieldCharge");
        weaponKey       = keyValet.GetKey("PlayerController-WeaponCharge");

        playerHandler.SetPlayerPosition(transform.localPosition);
        playerHandler.SetPlayerRotation(transform.localRotation);
        ChargeShieldBattery(true);
        ChargeWeaponBattery(true);

        waypointProgressTracker.SetForwardSpeed(basePlayerForwardSpeed);
    }
Esempio n. 22
0
    // This method spawns each enemy wave for the teams
    // Sends data to each minion playerstats script
    void SpawnMinion()
    {
        if (team == "blue")
        {
            adFinal  = scoreScript.blueTeamScore;
            adFinal *= 2;
            GameObject minionObj = (GameObject)uLink.Network.Instantiate(uLink.NetworkPlayer.server, BlueMinionProxy, BlueMinionProxy, BlueMinionCreator, transform.position, transform.rotation, 0);
            waypointScript         = minionObj.GetComponent <WaypointProgressTracker>();
            playerStatScript       = minionObj.GetComponent <PlayerStats>();
            minionScript           = minionObj.GetComponent <MinionsScript>();
            waypointScript.circuit = circuitScript;
            minionObj.name         = "BlueWave" + waveNumber.ToString();
        }
        if (team == "red")
        {
            adFinal  = scoreScript.redTeamScore;
            adFinal *= 2;
            GameObject minionObj = (GameObject)uLink.Network.Instantiate(uLink.NetworkPlayer.server, RedMinionProxy, RedMinionProxy, RedMinionCreator, transform.position, transform.rotation, 0);
            waypointScript         = minionObj.GetComponent <WaypointProgressTracker>();
            playerStatScript       = minionObj.GetComponent <PlayerStats>();
            minionScript           = minionObj.GetComponent <MinionsScript>();
            waypointScript.circuit = circuitScript;
            minionObj.name         = "RedWave" + waveNumber.ToString();
        }
        playerStatScript.playerTeam       = team;
        playerStatScript.maxHealth        = health + adFinal;
        playerStatScript.myHealth         = health + adFinal;
        playerStatScript.healthRegenerate = healthRegen;
        playerStatScript.playerLvl        = lvl;
        playerStatScript.expToGive        = expToGive;
        playerStatScript.goldToGive       = goldToGive;
        playerStatScript._bAdValue        = ad + adFinal;
        playerStatScript._bApValue        = ap;
        playerStatScript.adRes            = adRes;
        playerStatScript.apRes            = apRes;
        playerStatScript.UpdateStatsOnClients();
        minionScript.attackSpeed = 3;

        waveNumber++;
    }
    private void SelectDestination(Vertex previousVertex)
    {
        if (previousVertex == null)
        {
            path = roads.GetPathToRandomTarget(position);
        }
        else
        {
            List <Vertex> filteredVertices = new List <Vertex>();

            foreach (Edge e in position.GetEdges())
            {
                Vertex neighbor = e.GetNeighbor(position);
                if (neighbor != previousVertex)
                {
                    filteredVertices.Add(neighbor);
                }
            }

            if (filteredVertices.Count == 0)
            {
                path = roads.GetPathToRandomTarget(position);
            }
            else
            {
                Vertex randomNeighbor = filteredVertices[Random.Range(0, filteredVertices.Count)];
                path = roads.GetPathToRandomTarget(randomNeighbor);
                path.Prepend(position);
                path.Prepend(previousVertex);
            }
        }

        path.Calculate();
        WaypointProgressTracker wpt = this.GetComponent <WaypointProgressTracker>();

        wpt.Setup(new WaypointCircuit(path.GetPath()));
    }
    /// <summary>
    /// Sets the keys used for the experiment and the waypoint
    /// </summary>
    /// <param name="myVals">Array of float containing the parameters</param>
    /// <param name="waypointCircuit">WaypointCircuit that will be used for the experiment</param>
    protected void writeKeysOnDMC(float[] myVals, GameObject waypointCircuit)
    {
        // if the variables are empty, is assigns them
        dmc = (dmc != null ? dmc : GetComponent <droneMovementController>());
        wpt = (wpt != null ? wpt : GetComponent <WaypointProgressTracker>());

        // initializing new PIDs
        yPID     = new PID(myVals[0], myVals[1], myVals[2], myVals[3]);
        zPID     = new PID(myVals[4], myVals[5], myVals[6], myVals[7]);
        xPID     = new PID(myVals[4], myVals[5], myVals[6], myVals[7]);
        yawPID   = new PID(myVals[8], myVals[9], myVals[10], myVals[11]);
        rollPID  = new PID(myVals[12], myVals[13], myVals[14], myVals[15]);
        pitchPID = new PID(myVals[12], myVals[13], myVals[14], myVals[15]);

        // calls the functions in the droneMovementController to set the keys and the constants
        dmc.setKs(yPID, zPID, xPID, pitchPID, rollPID, yawPID);
        dmc.setConsts(myVals[16], myVals[17], myVals[18], myVals[19], myVals[20], myVals[22], myVals[23]);

        // spawns the WaypointCircuit and assign it to the drone
        Vector3 wpcPosition = this.transform.position + new Vector3(2, 6, 2);

        spawnedWaypoint = (GameObject)Instantiate(waypointCircuit, wpcPosition, Quaternion.identity);
        wpt.setWaypoint(spawnedWaypoint.GetComponent <WaypointCircuit>());
    }
Esempio n. 25
0
        public void AssignWaypointCircuit(GameObject newCar, WaypointCircuit circuit)
        {
            WaypointProgressTracker waypointTracker = newCar.GetComponent <WaypointProgressTracker>();

            waypointTracker.circuit = circuit;
        }
Esempio n. 26
0
    // Use this for initialization


    void Start()
    {
        Stoped     = false;
        controller = (CarController)this.GetComponent(typeof(CarController));
        tracker    = (CriterianProgress)this.GetComponent(typeof(CriterianProgress));
    }
Esempio n. 27
0
    void Start()
    {
        Ranking = GameObject.Find("Directional Light").GetComponent<csRanking>();

        Player1_traker = GameObject.Find("MyPlayer").GetComponent<WaypointProgressTracker>();
        Player2_traker = GameObject.Find("Computer1").GetComponent<WaypointProgressTracker>();
        Player3_traker = GameObject.Find("Computer2").GetComponent<WaypointProgressTracker>();
        Player4_traker = GameObject.Find("Computer3").GetComponent<WaypointProgressTracker>();

        P1_CollCheck = GameObject.Find("MyPlayer").GetComponent<csCollisionCheck>();
        P2_CollCheck = GameObject.Find("Computer1").GetComponent<csCollisionCheck>();
        P3_CollCheck = GameObject.Find("Computer2").GetComponent<csCollisionCheck>();
        P4_CollCheck = GameObject.Find("Computer3").GetComponent<csCollisionCheck>();

        P1_Controller = GameObject.Find("MyPlayer").GetComponent<CarController>();
        P2_Controller = GameObject.Find("Computer1").GetComponent<CarController>();
        P3_Controller = GameObject.Find("Computer2").GetComponent<CarController>();
        P4_Controller = GameObject.Find("Computer3").GetComponent<CarController>();
    }
Esempio n. 28
0
        private void FixedUpdate()
        {
            if (drop1.transform.childCount > 0 && drop2.transform.childCount > 0)
            {
                Destroy(preventsRollingDown);
                m_Car.Move(TURN, 2, 0, 0);

                if (!timeDone2)
                {
                    TURN = 0;
                    move_forward.color      = new Color32(255, 128, 0, 255);
                    if_else.color           = new Color32(150, 20, 45, 45);
                    if_else_content.color   = new Color32(150, 20, 45, 45);
                    if_statement.color      = new Color32(150, 20, 45, 45);
                    if_content.color        = new Color32(150, 20, 45, 45);
                    last_move_forward.color = new Color32(150, 20, 45, 45);


                    StartCoroutine(Example2((float)17));
                }
                if (timeDone2)
                {
                    ////debug.log("TURN!!!!" + correct_input.ToString());
                    if (correct_input)
                    {
                        //TURN = -1;
                        gameObject.AddComponent <CarAIControl>();
                        gameObject.AddComponent <WaypointProgressTracker>();

                        CarAIControl aiControl = GetComponent <CarAIControl>();
                        aiControl.m_Driving = true;
                        aiControl.SetStopWhenTargetReached(false);

                        WaypointProgressTracker wpt = GetComponent <WaypointProgressTracker>();
                        wpt.circuit = correctcircuit;
                        wpt.target  = WaypointTargetObject.transform;
                    }
                    else
                    {
                        //TURN = 1;
                        gameObject.AddComponent <CarAIControl>();
                        gameObject.AddComponent <WaypointProgressTracker>();

                        CarAIControl aiControl = GetComponent <CarAIControl>();
                        aiControl.m_Driving = true;
                        aiControl.SetStopWhenTargetReached(false);

                        WaypointProgressTracker wpt = GetComponent <WaypointProgressTracker>();
                        wpt.circuit = wrongcircuit;
                        wpt.target  = WaypointTargetObject.transform;
                    }
                    move_forward.color = new Color32(150, 20, 45, 45);
                    if (!entered)
                    {
                        if_statement.color = new Color32(255, 128, 0, 255);
                        StartCoroutine(Example((float)0.2));
                        explainIfElse.SetActive(true);
                    }
                    else if (timeDone)
                    {
                        if_statement.color    = new Color32(150, 20, 45, 45);
                        if_content.color      = new Color32(150, 20, 45, 45);
                        if_else.color         = new Color32(255, 128, 0, 255);
                        if_else_content.color = new Color32(255, 128, 0, 255);
                        if_statement_done     = true;
                    }
                    if (timeDone3)
                    {
                        //TURN = 0;
                        if_else.color           = new Color32(150, 20, 45, 45);
                        if_else_content.color   = new Color32(150, 20, 45, 45);
                        if_statement.color      = new Color32(150, 20, 45, 45);
                        if_content.color        = new Color32(150, 20, 45, 45);
                        last_move_forward.color = new Color32(255, 128, 0, 255);
                        //m_Car.Move(0, 2, 0, 0);
                    }
                }

                if (!timeDone3)
                {
                    StartCoroutine(Example3((float)18));
                }



                // ENUMERATORS THAT ARE RUN THROUGH COROUTINES

                IEnumerator Example(float time)
                {
                    timeDone = false;
                    yield return(new WaitForSeconds((float)time));

                    timeDone = true;
                    entered  = true;
                }

                IEnumerator Example2(float time)
                {
                    ////debug.log("It reached here2");
                    timeDone2 = false;
                    yield return(new WaitForSeconds((float)time));

                    timeDone2 = true;
                    ////debug.log("It reached here3" + timeDone2.ToString());
                }

                IEnumerator Example3(float time)
                {
                    timeDone3 = false;
                    yield return(new WaitForSeconds((float)time));

                    timeDone3 = true;
                    ////debug.log("It reached here4" + timeDone2.ToString());
                }
            }
        }
Esempio n. 29
0
    ///
    void Start()
    {
        GameFIN = GameObject.Find("Directional Light").GetComponent<csGameFINISH>();

        Player1_traker = GameObject.Find("MyPlayer").GetComponent<WaypointProgressTracker>();
        Player2_traker = GameObject.Find("Computer1").GetComponent<WaypointProgressTracker>();
        Player3_traker = GameObject.Find("Computer2").GetComponent<WaypointProgressTracker>();
        Player4_traker = GameObject.Find("Computer3").GetComponent<WaypointProgressTracker>();

        Player1_CollCheck = GameObject.Find("MyPlayer").GetComponent<csCollisionCheck>();
        Player2_CollCheck = GameObject.Find("Computer1").GetComponent<csCollisionCheck>();
        Player3_CollCheck = GameObject.Find("Computer2").GetComponent<csCollisionCheck>();
        Player4_CollCheck = GameObject.Find("Computer3").GetComponent<csCollisionCheck>();

        P1_Car_State = GameObject.Find("MyPlayer").GetComponent<csCarState>();
        P2_Car_State = GameObject.Find("Computer1").GetComponent<csCarState>();
        P3_Car_State = GameObject.Find("Computer2").GetComponent<csCarState>();
        P4_Car_State = GameObject.Find("Computer3").GetComponent<csCarState>();

        P1_Carcontroller = GameObject.Find("MyPlayer").GetComponent<CarController>();
        P2_Carcontroller = GameObject.Find("Computer1").GetComponent<CarController>();
        P3_Carcontroller = GameObject.Find("Computer2").GetComponent<CarController>();
        P4_Carcontroller = GameObject.Find("Computer3").GetComponent<CarController>();

        P1_Speed1_0x = P1_Car_State.maxSpeed;
        P1_Speed1_1x = P1_Car_State.maxSpeed * 1.5f;
        P1_Speed1_2x = P1_Car_State.maxSpeed * 2.0f;

        P2_Speed1_0x = P2_Car_State.maxSpeed;
        P2_Speed1_1x = P2_Car_State.maxSpeed * 1.5f;
        P2_Speed1_2x = P2_Car_State.maxSpeed * 2.0f;

        P3_Speed1_0x = P3_Car_State.maxSpeed;
        P3_Speed1_1x = P3_Car_State.maxSpeed * 1.5f;
        P3_Speed1_2x = P3_Car_State.maxSpeed * 2.0f;

        P4_Speed1_0x = P4_Car_State.maxSpeed;
        P4_Speed1_1x = P4_Car_State.maxSpeed * 1.5f;
        P4_Speed1_2x = P4_Car_State.maxSpeed * 2.0f;
    }
Esempio n. 30
0
 void Start()
 {
     pTracker = transform.parent.parent.GetComponent <WaypointProgressTracker> ();
 }
Esempio n. 31
0
 void Start()
 {
     car = GetComponent<CarController>();
     car_state = GetComponent<csCarState>();
     ai = GetComponent<CarAIControl>();
     tracker = GetComponent<WaypointProgressTracker>();
     Original_Destroy = GameObject.Find("Original_Target_Setting").GetComponent<csDestroy_Original>();
     Ranking = GameObject.Find("Directional Light").GetComponent<csRanking>();
     GameTimer = GameObject.Find("Directional Light").GetComponent<csGameTimer>();
 }
Esempio n. 32
0
 void Start()
 {
     ai = GetComponent<CarAIControl>();
     CollCheck = GetComponent<csCollisionCheck>();
     car = GetComponent<CarController>();
     childBody = gameObject.transform.FindChild("Image").gameObject;
     car_body = gameObject.transform.FindChild("Body").gameObject;
     Big_Jump_Target = GameObject.Find("Big_Jump_Area").transform.FindChild("Big_Jump_Point");
     Big_Jump_Target1 = GameObject.Find("Big_Jump_Area").transform.FindChild("Big_Jump_Point1");
     tracker = GetComponent<WaypointProgressTracker>();
     StartCoroutine(JumperTrigger());
 }
Esempio n. 33
0
 void Start()
 {
     tracker = GetComponent <WaypointProgressTracker>();
 }
Esempio n. 34
0
 private int WaypointSorter(WaypointProgressTracker c1, WaypointProgressTracker c2)
 {
     //higher lap
     if (
         GetComponentInParent<CheckpointManager>().GetPositionFromCar(c1.GetComponentInParent<CarController>()).lap
         > GetComponentInParent<CheckpointManager>().GetPositionFromCar(c2.GetComponentInParent<CarController>()).lap)
     {
         return -1;
     }
     //higher lap
     if (
         GetComponentInParent<CheckpointManager>().GetPositionFromCar(c2.GetComponentInParent<CarController>()).lap
         > GetComponentInParent<CheckpointManager>().GetPositionFromCar(c1.GetComponentInParent<CarController>()).lap)
     {
         return 1;
     }
     //lower waypoint
     if (c2.LastWayPointObject.Key == 0 &&
         GetComponentInParent<CheckpointManager>().GetPositionFromCar(c2.GetComponentInParent<CarController>()).lap >=
         GetComponentInParent<CheckpointManager>().TotalLaps)
         return 1;
     //lower waypoint
     if (c1.LastWayPointObject.Key == 0 &&
         GetComponentInParent<CheckpointManager>().GetPositionFromCar(c1.GetComponentInParent<CarController>()).lap >=
         GetComponentInParent<CheckpointManager>().TotalLaps)
         return -1;
     //higher waypoint
     if (c1.LastWayPointObject.Key > c2.LastWayPointObject.Key)
     {
         return -1;
     }
     //same waypoint
     if (c1.LastWayPointObject.Key == c2.LastWayPointObject.Key)
     {
         //same waypoint higher distance
         if (c1.LastWayPointObject.Value > c2.LastWayPointObject.Value)
             return -1;
         return 1;
     }
     return 1;
 }
Esempio n. 35
0
    ///
    void Start()
    {
        GooglePlayGames.PlayGamesPlatform.Activate();

        P1_Button_Text.text = UserManager.Instance().name;

        GameFIN = GameObject.Find("Directional Light").GetComponent<csGameFINISH>();

        P1_Name.text = UserManager.Instance().name;

        Player1_traker = GameObject.Find("MyPlayer").GetComponent<WaypointProgressTracker>();
        Player2_traker = GameObject.Find("Computer1").GetComponent<WaypointProgressTracker>();
        Player3_traker = GameObject.Find("Computer2").GetComponent<WaypointProgressTracker>();
        Player4_traker = GameObject.Find("Computer3").GetComponent<WaypointProgressTracker>();

        Player1_CollCheck = GameObject.Find("MyPlayer").GetComponent<csCollisionCheck>();
        Player2_CollCheck = GameObject.Find("Computer1").GetComponent<csCollisionCheck>();
        Player3_CollCheck = GameObject.Find("Computer2").GetComponent<csCollisionCheck>();
        Player4_CollCheck = GameObject.Find("Computer3").GetComponent<csCollisionCheck>();

        P1_Car_State = GameObject.Find("MyPlayer").GetComponent<csCarState>();
        P2_Car_State = GameObject.Find("Computer1").GetComponent<csCarState>();
        P3_Car_State = GameObject.Find("Computer2").GetComponent<csCarState>();
        P4_Car_State = GameObject.Find("Computer3").GetComponent<csCarState>();

        P1_Carcontroller = GameObject.Find("MyPlayer").GetComponent<CarController>();
        P2_Carcontroller = GameObject.Find("Computer1").GetComponent<CarController>();
        P3_Carcontroller = GameObject.Find("Computer2").GetComponent<CarController>();
        P4_Carcontroller = GameObject.Find("Computer3").GetComponent<CarController>();

        P1_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P1_Speed1_0x = P1_Car_State.maxSpeed * 1.2f;
        P1_Speed1_1x = P1_Car_State.maxSpeed * 1.5f;
        P1_Speed1_2x = P1_Car_State.maxSpeed * 2.0f;

        P2_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P2_Speed1_0x = P2_Car_State.maxSpeed * 1.2f;
        P2_Speed1_1x = P2_Car_State.maxSpeed * 1.5f;
        P2_Speed1_2x = P2_Car_State.maxSpeed * 2.0f;

        P3_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P3_Speed1_0x = P3_Car_State.maxSpeed * 1.2f;
        P3_Speed1_1x = P3_Car_State.maxSpeed * 1.5f;
        P3_Speed1_2x = P3_Car_State.maxSpeed * 2.0f;

        P4_Speed1_Ex = P1_Car_State.maxSpeed * 0.8f;
        P4_Speed1_0x = P4_Car_State.maxSpeed * 1.2f;
        P4_Speed1_1x = P4_Car_State.maxSpeed * 1.5f;
        P4_Speed1_2x = P4_Car_State.maxSpeed * 2.0f;
    }
Esempio n. 36
0
        // ------------------------------------------------- //

        private void Awake()
        {
            carAI           = GetComponent <CarAIControl>();
            carController   = GetComponent <CarController>();
            waypointTracker = GetComponent <WaypointProgressTracker>();
        }