Example #1
0
 public void UpdateRank(UpdateRankEvent e, UserRankNode userRank, [JoinByUser, Combine] RankIconNode rankIcon)
 {
     rankIcon.rankIcon.SetRank(userRank.userRank.Rank);
 }
Example #2
0
 public void PlayUpdateUserRankEffect(UpdateRankEvent e, UserRankNode user, [JoinByUser] NotReadyTankNode tank)
 {
     tank.Entity.AddComponent <UpdateUserRankEffectReadyComponent>();
 }
Example #3
0
 public void SetIcon(NodeAddedEvent e, [Combine] RankIconNode rankIcon, [Context, JoinByUser] UserRankNode userRank)
 {
     rankIcon.rankIcon.SetRank(userRank.userRank.Rank);
 }
Example #4
0
        public void PlayUpdateRankEffect(UpdateUserRankEffectEvent evt, ReadyTankNode tank, UserRankNode user, [JoinByUser] BattleUserNode battleUser)
        {
            GameObject effectPrefab = tank.updateUserRankEffect.EffectPrefab;
            GetInstanceFromPoolEvent eventInstance = new GetInstanceFromPoolEvent {
                Prefab          = effectPrefab,
                AutoRecycleTime = effectPrefab.GetComponent <UpdateRankEffectSettings>().DestroyTimeDelay
            };

            base.ScheduleEvent(eventInstance, tank);
            Transform  instance   = eventInstance.Instance;
            GameObject gameObject = instance.gameObject;
            Transform  transform  = new GameObject("RankEffectRoot").transform;

            transform.parent        = tank.tankVisualRoot.transform;
            transform.localPosition = Vector3.zero;
            transform.localRotation = Quaternion.identity;
            transform.localScale    = Vector3.one;
            transform.gameObject.AddComponent <UpdateUserRankTransformBehaviour>().Init();
            instance.parent        = transform;
            instance.localPosition = Vector3.zero;
            instance.localRotation = Quaternion.identity;
            instance.localScale    = Vector3.one;
            foreach (UpdateRankEffectParticleMovement movement in gameObject.GetComponentsInChildren <UpdateRankEffectParticleMovement>(true))
            {
                movement.parent = transform;
            }
            transform.GetComponentInChildren <UpdateRankEffectSettings>(true).icon.SetRank(user.userRank.Rank);
            gameObject.SetActive(true);
            base.NewEvent <UpdateRankEffectFinishedEvent>().Attach(battleUser).ScheduleDelayed(tank.updateUserRankEffect.FinishEventTime);
            if (!tank.Entity.HasComponent <UpdateUserRankEffectInstantiatedComponent>())
            {
                tank.Entity.AddComponent <UpdateUserRankEffectInstantiatedComponent>();
            }
            tank.Entity.RemoveComponent <UpdateUserRankEffectReadyComponent>();
        }