Пример #1
0
    // Use this for initialization
    void Start()
    {
        obj_Red  = new HashSet <GameObject>(GameObject.FindGameObjectsWithTag("Red"));
        obj_Blue = new HashSet <GameObject>(GameObject.FindGameObjectsWithTag("Blue"));

        foreach (GameObject Red in obj_Red)
        {
            Red.SetActive(false);
            Debug.Log("Red Object(s) are hidden");
        }

        foreach (GameObject Blue in obj_Blue)
        {
            Blue.SetActive(true);
        }

        obj_is_red = false;
    }
Пример #2
0
    public void ChangeGameState()
    {
        // which objects will be active
        bool blue_active = !obj_is_red;
        bool red_active  = obj_is_red;

        // update game state
        obj_is_red = !obj_is_red;
        foreach (GameObject Red in obj_Red)
        {
            //Debug.Log(light);
            Red.SetActive(red_active);
        }

        foreach (GameObject Blue in obj_Blue)
        {
            //Debug.Log(dark);
            Blue.SetActive(blue_active);
        }
    }
Пример #3
0
    void OnMouseUp()
    {
        if (blueControl == true)
        {
            Blue.SetActive(true);
            score         += 8;
            scoreText.text = "Score: " + score;
            counter++;
            Destroy(this.gameObject);
        }
        if (redControl == true)
        {
            Red.SetActive(true);
            score         += 8;
            scoreText.text = "Score: " + score;
            counter++;
            Destroy(this.gameObject);
        }
        if (greenControl == true)
        {
            Green.SetActive(true);
            score         += 8;
            scoreText.text = "Score: " + score;
            counter++;
            Destroy(this.gameObject);
        }

        score                     = score - 3;
        scoreText.text            = "Score: " + score;
        this.transform.localScale = new Vector3(20, 20, 20);
        this.transform.position   = startPos;

        if (counter == 3)
        {
            bottles.GetComponent <Animator>().Play("Move2");
        }
        if (counter == 6)
        {
            finish.SetActive(true);
        }
    }
Пример #4
0
 void OnTriggerEnter(Collider other)
 {
     if (!other.gameObject.CompareTag("restart"))
     {
         Debug.Log("Se ha tomado la carta color " + other.gameObject.name);
         obtained.Add(other.gameObject.name);
     }
     other.gameObject.SetActive(false);
     if (other.gameObject.CompareTag("restart"))
     {
         buttons.SetActive(true);
         Yellow.SetActive(true);
         Red.SetActive(true);
         Green.SetActive(true);
         Black.SetActive(true);
         Blue.SetActive(true);
         obtained.Clear();
         text = "";
         //set random card again
     }
 }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     carimport = GlobalCar.Cartype;
     if (carimport == 1)
     {
         Red.SetActive(true);
         Blue.SetActive(false);
         Green.SetActive(false);
     }
     if (carimport == 2)
     {
         Blue.SetActive(true);
         Red.SetActive(false);
         Green.SetActive(false);
     }
     if (carimport == 3)
     {
         Green.SetActive(true);
         Red.SetActive(false);
         Blue.SetActive(false);
     }
 }
    // Use this for initialization
    void Start()
    {
        Red.SetActive(false);
        Blue.SetActive(false);
        Danger.SetActive(false);
        Warning.SetActive(false);
        ArrowL.SetActive(false);
        ArrowR.SetActive(false);
        Speeder.SetActive(false);

        red     = false;
        blue    = false;
        danger  = false;
        warning = false;
        arrowR  = false;
        arrowL  = false;
        speeder = false;

        slipR       = false;
        slipL       = false;
        nextTunnel  = false;
        tunnel      = false;
        way         = false;
        RoL         = false;
        RoR         = false;
        rotate      = 0;
        speed       = 2f;
        roteteSpeed = 10f;
        totateSpeed = 10f;
        check       = 0;
        checkTunnel = 0;
        checkRoY    = 0;
        timeCre     = 0;
        sp          = 10;
        maxSp       = 200;
        anim        = GetComponent <Animator>();
        source1     = GetComponent <AudioSource>();
        rb          = GetComponent <Rigidbody>();
    }
    public void Detecter()
    {
        if (red == true)
        {
            Red.SetActive(true);
            //camShake.cameraShake();
            StartCoroutine(close());
        }

        if (blue == true)
        {
            Blue.SetActive(true);
            //camShake.cameraShake();
            StartCoroutine(close());
        }

        if (danger == true)
        {
            Danger.SetActive(true);
            StartCoroutine(close());
        }

        if (warning == true)
        {
            Warning.SetActive(true);
            StartCoroutine(close());
        }

        if (arrowL == true)
        {
            ArrowL.SetActive(true);
            StartCoroutine(close());
        }

        if (arrowR == true)
        {
            ArrowR.SetActive(true);
            StartCoroutine(close());
        }

        if (speeder == true)
        {
            Speeder.SetActive(true);
            StartCoroutine(close());
        }



        if (red == false)
        {
            Red.SetActive(false);
        }

        if (blue == false)
        {
            Blue.SetActive(false);
        }

        if (danger == false)
        {
            Danger.SetActive(false);
        }

        if (warning == false)
        {
            Warning.SetActive(false);
        }

        if (arrowL == false)
        {
            ArrowL.SetActive(false);
        }

        if (arrowR == false)
        {
            ArrowR.SetActive(false);
        }
        if (speeder == false)
        {
            Speeder.SetActive(false);
        }
    }