Exemple #1
0
        protected override void RemoveFieldCallbacks()
        {
            if (workerIdUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in workerIdUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                workerIdUpdateCallbackToCallbackKey.Clear();
            }

            if (workerTypeUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in workerTypeUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                workerTypeUpdateCallbackToCallbackKey.Clear();
            }

            if (connectionUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in connectionUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                connectionUpdateCallbackToCallbackKey.Clear();
            }
        }
Exemple #2
0
        protected override void RemoveFieldCallbacks()
        {
            if (nestedFieldUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in nestedFieldUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                nestedFieldUpdateCallbackToCallbackKey.Clear();
            }

            if (other0FieldUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in other0FieldUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                other0FieldUpdateCallbackToCallbackKey.Clear();
            }

            if (other1FieldUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in other1FieldUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                other1FieldUpdateCallbackToCallbackKey.Clear();
            }
        }
Exemple #3
0
        protected override void RemoveFieldCallbacks()
        {
            if (aUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in aUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                aUpdateCallbackToCallbackKey.Clear();
            }

            if (bUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in bUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                bUpdateCallbackToCallbackKey.Clear();
            }

            if (cUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in cUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                cUpdateCallbackToCallbackKey.Clear();
            }
        }
    //コマの待機位置調整
    public void moveComaToWaitePosition(Action aCallback)
    {
        CallbackSystem tSystem = new CallbackSystem();

        foreach (PlayerStatus tStatus in mTurnOrder)
        {
            if (tStatus.isEnd())
            {
                continue;
            }
            int tDup = 0;
            int tOrd = 0;
            foreach (PlayerStatus tStatus2 in mTurnOrder)
            {
                if (tStatus2.isEnd())
                {
                    continue;
                }
                if (tStatus.mCurrentMassNumber != tStatus2.mCurrentMassNumber)
                {
                    continue;
                }
                tDup++;
                if (tStatus.mPlayerNumber > tStatus2.mPlayerNumber)
                {
                    tOrd++;
                }
            }
            Action tCallback = tSystem.getCounter();
            tStatus.mComa.moveTo(mFeild.mMassList[tStatus.mCurrentMassNumber].position + getWaitePosition(tDup, tOrd), 0.2f, tCallback);
        }
        tSystem.then(aCallback);
    }
        protected override void RemoveEventCallbacks()
        {
            if (fooEventEventCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in fooEventEventCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                fooEventEventCallbackToCallbackKey.Clear();
            }
        }
        protected override void RemoveFieldCallbacks()
        {
            if (grandchildUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in grandchildUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                grandchildUpdateCallbackToCallbackKey.Clear();
            }
        }
Exemple #7
0
        protected override void RemoveFieldCallbacks()
        {
            if (entityTypeUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in entityTypeUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                entityTypeUpdateCallbackToCallbackKey.Clear();
            }
        }
Exemple #8
0
        protected override void RemoveFieldCallbacks()
        {
            if (componentInterestUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in componentInterestUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                componentInterestUpdateCallbackToCallbackKey.Clear();
            }
        }
Exemple #9
0
        protected override void RemoveFieldCallbacks()
        {
            if (field1UpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in field1UpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                field1UpdateCallbackToCallbackKey.Clear();
            }

            if (field2UpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in field2UpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                field2UpdateCallbackToCallbackKey.Clear();
            }

            if (field3UpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in field3UpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                field3UpdateCallbackToCallbackKey.Clear();
            }

            if (field4UpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in field4UpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                field4UpdateCallbackToCallbackKey.Clear();
            }

            if (field5UpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in field5UpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                field5UpdateCallbackToCallbackKey.Clear();
            }
        }
        protected override void RemoveFieldCallbacks()
        {
            if (locationUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in locationUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                locationUpdateCallbackToCallbackKey.Clear();
            }

            if (rotationUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in rotationUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                rotationUpdateCallbackToCallbackKey.Clear();
            }

            if (velocityUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in velocityUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                velocityUpdateCallbackToCallbackKey.Clear();
            }

            if (physicsTickUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in physicsTickUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                physicsTickUpdateCallbackToCallbackKey.Clear();
            }

            if (ticksPerSecondUpdateCallbackToCallbackKey != null)
            {
                foreach (var callbackToKey in ticksPerSecondUpdateCallbackToCallbackKey)
                {
                    CallbackSystem.UnregisterCallback(callbackToKey.Value);
                }

                ticksPerSecondUpdateCallbackToCallbackKey.Clear();
            }
        }
    //ターンの順番に並び替え
    public void sortInOrder(List <PlayerStatus> aStatus, Action aCallback)
    {
        CallbackSystem tSystem = new CallbackSystem();

        for (int i = 0; i < aStatus.Count; i++)
        {
            PlayerStatus tStatus  = aStatus[i];
            Action       tCounter = tSystem.getCounter();
            mDisplays[tStatus.mPlayerNumber - 1].moveTo(getDisplayPosition(i), 0.5f, () => {
                tCounter();
            });
        }
        tSystem.then(aCallback);
    }
Exemple #12
0
    /// <summary>プレイヤの順番シャッフル</summary>
    public static void playerShuffle(PlayerStatusDisplay[] aDisplay, PlayerStatus[] aStatus, int[] aTurn, Action aCallback)
    {
        //手番順に座標を配列に格納
        Vector2[] tTurnPosition = new Vector2[aDisplay.Length];
        for (int i = 0; i < aDisplay.Length; i++)
        {
            int tTurn = aStatus[i].mTurn;
            tTurnPosition[tTurn] = aDisplay[i].position2D;
        }
        //シャッフル結果の座標をプレイヤ番号順に格納
        Vector2[] tResultPosition = new Vector2[aDisplay.Length];
        for (int i = 0; i < aDisplay.Length; i++)
        {
            int tPlayerNum = aTurn[i];
            tResultPosition[tPlayerNum] = tTurnPosition[i];
        }
        //全てのdisplayの中央座標
        Vector2 tCenter = new Vector2(0, 0);

        for (int i = 0; i < aDisplay.Length; i++)
        {
            tCenter += tTurnPosition[i];
        }
        tCenter /= aDisplay.Length;
        //アニメーション
        MyBehaviour.setTimeoutToIns(1, () => {
            //中央に集める
            CallbackSystem tSystem = new CallbackSystem();
            for (int i = 0; i < aDisplay.Length; i++)
            {
                aDisplay[i].moveTo(tCenter, 0.2f, tSystem.getCounter());
            }
            tSystem.then(() => {
                MyBehaviour.setTimeoutToIns(0.5f, () => {
                    //それぞれの位置へ移動
                    CallbackSystem tSystem2 = new CallbackSystem();
                    for (int i = 0; i < aDisplay.Length; i++)
                    {
                        aDisplay[i].moveTo(tResultPosition[i], 0.2f, tSystem2.getCounter());
                    }
                    tSystem2.then(aCallback);
                });
            });
        });
    }
Exemple #13
0
    public void flipAndExpand(Action aCallback = null)
    {
        CallbackSystem tSystem  = new CallbackSystem();
        Action         tCounter = tSystem.getCounter();

        this.opacityBy(-0.9f, 1f, tSystem.getCounter());
        this.scaleToWithSpeed(new Vector2(0, 1.5f), 3, () => {
            mNumber.text = "";
            showFront();
            this.scaleToWithSpeed(new Vector2(2, 2), 3, () => {
                tCounter();
            });
        });
        tSystem.then(() => { if (aCallback != null)
                             {
                                 aCallback();
                             }
                     });
    }
    private void moveFood(PlayerStatus aGetter, PlayerStatus aPayer, int aFood, Action aCallback)
    {
        MySoundPlayer.playSe("decision14");
        aGetter.mFood += aFood;
        aPayer.mFood  -= aFood;
        sortPlayerRank();
        CallbackSystem tSystem = new CallbackSystem();

        GameAnimation.getFood(mElement.mPlayerStatusDisplay[aGetter.mPlayerNumber], aFood, tSystem.getCounter());
        GameAnimation.getFood(mElement.mPlayerStatusDisplay[aPayer.mPlayerNumber], -aFood, tSystem.getCounter());
        tSystem.then(() => {
            if (aPayer.mFood < 0)
            {
                endanger(aPayer, aCallback);
                return;
            }
            aCallback();
        });
    }
Exemple #15
0
    /// <summary>
    /// 透明度を変化させる
    /// </summary>
    /// <param name="delta">変化量</param>
    /// <param name="duration">変化時間</param>
    /// <param name="callback">完了時コールバック</param>
    public void opacityBy(float delta, float duration, Action callback = null)
    {
        CallbackSystem system = new CallbackSystem();

        foreach (SpriteRenderer tC in GetComponentsInChildren <SpriteRenderer>())
        {
            StartCoroutine(opacityDelta(tC, delta, duration, system.getCounter()));
        }
        foreach (TextMesh tC in GetComponentsInChildren <TextMesh>())
        {
            StartCoroutine(opacityDelta(tC, delta, duration, system.getCounter()));
        }
        foreach (Image tC in GetComponentsInChildren <Image>())
        {
            StartCoroutine(opacityDelta(tC, delta, duration, system.getCounter()));
        }
        foreach (Text tC in GetComponentsInChildren <Text>())
        {
            StartCoroutine(opacityDelta(tC, delta, duration, system.getCounter()));
        }
        system.then(callback);
    }
Exemple #16
0
    static public void lostCoin(Vector3 aPosition, string aLabel, Action aCallback)
    {
        MyBehaviour tContainer = MyBehaviour.create <MyBehaviour>();

        tContainer.name     = "lostCoin";
        tContainer.position = aPosition;

        MySoundPlayer.playSe("lost", false);

        CallbackSystem tSystem = new CallbackSystem();
        KinCoin        tPrefab = Resources.Load <KinCoin>("prefabs/game/effect/coin");

        for (int i = 0; i < 10; i++)
        {
            Action tCounter = tSystem.getCounter();
            MyBehaviour.setTimeoutToIns(0.1f * i, () => {
                KinCoin tCoin = GameObject.Instantiate(tPrefab);
                tCoin.transform.SetParent(tContainer.transform, false);
                tCoin.lost(tCounter);
            });
        }
        tSystem.then(aCallback);
    }