Пример #1
0
        public void Init(BOX_COLOR _color, int _x, int _y)
        {
            Box_Color = _color;

            transform.localPosition = new Vector3(200.0f + 40.0f * _x, 150.0f - 40.0f * _y, .0f);
            transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        }
Пример #2
0
 public void Init(Vector3 _pos, BOX_COLOR _color)
 {
     gameManager        = GameObject.Find("GameManager").GetComponent <GameManager>();
     renderer           = GetComponent <Renderer>();
     BoxColor           = _color;
     transform.position = _pos;
 }
Пример #3
0
 public void Init(BOX_COLOR _color, int _x, int _y)
 {
     image    = GetComponent <Image>();
     BoxColor = _color;
     transform.localPosition = new Vector3(40.0f + 9.0f * _x, 40.0f - 9.0f * _y, 0.0f);
     transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
 }
Пример #4
0
    public void Init(Vector3 base_pos, BOX_COLOR _color)
    {
        gameManager    = GameObject.Find("GameManager").GetComponent <GameManager> ();
        circular_gauge = GameObject.Find("Circular_Gauge").GetComponent <Circular_Gauge> ();
        move_speed     = 2.0f;
        Box_Color      = _color;
        is_on          = false;

        Set_Pos(base_pos);
    }
Пример #5
0
    public void Init(Vector3 _basePos, BOX_COLOR _color)
    {
        gameManager   = GameObject.Find("GameManager").GetComponent <GameManager>();
        circularGauge = GameObject.Find("CircularGauge").GetComponent <Circular_Gauge>();
        moveSpeed     = 2.0f;
        BoxColor      = _color;
        isOn          = false;

        transform.position = _basePos;
    }
Пример #6
0
 public void Change_Box_Color()
 {
     if ((int)Box_Color < 4)
     {
         Box_Color++;
     }
     else
     {
         Box_Color = 0;
     }
 }
Пример #7
0
    private void Create_Box(Vector3 base_pos)
    {
        GameObject clone = Instantiate(box_prefab) as GameObject;

        clone.transform.name = string.Format("{0}{1:D3}", "Box_", count);
        count++;
        BOX_COLOR _color = (BOX_COLOR)Random.Range(0, 3);
        Box       box    = clone.GetComponent <Box> ();

        box.Init(base_pos, _color);
    }
Пример #8
0
        private void Create_Box(Vector3 base_pos, int _idx)
        {
            GameObject clone = Instantiate(box_prefab) as GameObject;

            BOX_COLOR _color = (BOX_COLOR)Random.Range(0, 5);

            Box box = clone.GetComponent <Box>();

            box.Init(base_pos, _color);

            BoxArr[_idx] = box;
        }
Пример #9
0
    void CreateBox(Vector3 _pos, int _idx)
    {
        GameObject clone = Instantiate(boxPrefab);

        BOX_COLOR color = (BOX_COLOR)Random.Range(0, 5);

        Box box = clone.GetComponent <Box>();

        box.Init(_pos, color);

        BoxArr[_idx] = box;
    }
Пример #10
0
    void CreateUIBox(int _x, int _y, int _idx)
    {
        GameObject clone = Instantiate(uiBoxPrefab);

        BOX_COLOR color = (BOX_COLOR)Random.Range(0, 5);

        clone.transform.SetParent(GameObject.Find("Canvas").transform);

        UIBox box = clone.GetComponent <UIBox>();

        box.Init(color, _x, _y);
        UIBoxArr[_idx] = box;
    }
Пример #11
0
        private void Create_UIBox(int x, int y, int _idx)
        {
            GameObject clone = Instantiate(uiBox_prefab) as GameObject;

            BOX_COLOR _color = (BOX_COLOR)Random.Range(0, 5);

            clone.transform.SetParent(GameObject.Find("Canvas").transform);

            UIBox box = clone.GetComponent <UIBox>();

            box.Init(_color, x, y);

            UIBoxArr[_idx] = box;
        }
Пример #12
0
    //private void Update()
    //{
    //    createTime -= Time.deltaTime;
    //    if (createTime > 0.0f)
    //    {
    //        CreateBox();
    //        MakeBox();
    //        createTime = 1.0f;
    //    }
    //}

    private void CreateBox()
    {
        GameObject clone = base.MakeBox();
        Box2       box   = clone.GetComponent <Box2>();

        clone.transform.name = string.Format("{0}{1:D3}", "BOX_", boxCount++);

        Vector3 _pos = new Vector3((float)UnityEngine.Random.Range(-3, 4), (float)UnityEngine.Random.Range(-3, 4), 20.0f);
        //_pos.x = (float)UnityEngine.Random.Range(-3, 4);
        //_pos.y = (float)UnityEngine.Random.Range(-3, 4);

        BOX_COLOR _color = (BOX_COLOR)UnityEngine.Random.Range(0, 3);

        box.Init(_pos, _color);
    }
Пример #13
0
    /*void Update()
     * {
     *      createTime -= Time.deltaTime;
     *      if ( createTime <= 0.0f )
     *      {
     *              CreateBox();
     *              createTime = 1.0f;
     *      }
     * }*/
    void CreateBox()
    {
        GameObject clone = Instantiate(box_prefab);
        Box        box   = clone.GetComponent <Box>();

        clone.transform.name = string.Format("{0}{1:D3}", "BOX_", boxCount++);

        Vector3 _pos;

        _pos.x = (float)Random.Range(-3, 4);
        _pos.y = (float)Random.Range(-3, 4);
        _pos.z = 20.0f;

        BOX_COLOR _color = (BOX_COLOR)Random.Range(0, 3);

        box.Init(_pos, _color);
    }