Exemple #1
0
    public override void GameInit()
    {
        this.targetColorId           = (DEFINE.COLOR_ID)Random.Range(0, selectColorIds.Length - 1);
        this.targetItemList          = new LinkedList <GMCatchItemComponent> ();
        this.wallTop.localPosition   = Vector3.up * (ScreenScale.MANUAL_SIZE.y / 2f - 50f);
        this.wallBtm.localPosition   = Vector3.down * ScreenScale.MANUAL_SIZE.y / 2f;
        this.wallLeft.localPosition  = Vector3.left * ScreenScale.MANUAL_SIZE.x / 2f;
        this.wallRight.localPosition = Vector3.right * ScreenScale.MANUAL_SIZE.x / 2f;

        DEFINE.COLOR_ID colorId = this.targetColorId;
        for (int i = 0; i < selectCount; i++)
        {
            colorId = (DEFINE.COLOR_ID)(i % selectColorIds.Length);
            GMCatchItemComponent itemComp = Util.InstantiateComponent <GMCatchItemComponent>(this.prefabItem, this.parentItems);
            itemComp.Init(colorId, this.OnSelectItem);
            if (colorId.Equals(this.targetColorId))
            {
                this.targetItemList.AddLast(itemComp);
            }
//			colorId = (DEFINE.COLOR_ID)Random.Range (0, selectColorIds.Length);
        }
        base.GameInit();
    }