コード例 #1
0
ファイル: StageManager.cs プロジェクト: slb1988/agame
        private void ApplyStageEffectSetting(ConfigStageEffectSetting setting)
        {
            BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

            this.AddEntityEffectPredicates(localAvatar, setting.LocalAvatarEffectPredicates);
            this._localAvatarPredicates = setting.LocalAvatarEffectPredicates;
            if (setting.AvatarColorOverrides.Length > 0)
            {
                List <BaseMonoAvatar> allPlayerAvatars = Singleton <AvatarManager> .Instance.GetAllPlayerAvatars();

                for (int i = 0; i < allPlayerAvatars.Count; i++)
                {
                    BaseMonoAvatar     avatar2   = allPlayerAvatars[i];
                    MonoEffectOverride component = avatar2.GetComponent <MonoEffectOverride>();
                    if (component == null)
                    {
                        component = avatar2.gameObject.AddComponent <MonoEffectOverride>();
                    }
                    for (int j = 0; j < setting.AvatarColorOverrides.Length; j++)
                    {
                        ColorOverrideEntry entry = setting.AvatarColorOverrides[j];
                        component.colorOverrides.Add(entry.colorOverrideKey, entry.color);
                    }
                }
            }
        }
コード例 #2
0
        private void InitPlay()
        {
            BaseMonoAvatar avatar = Singleton <AvatarManager> .Instance.TryGetLocalAvatar();

            this._avatarTransform = avatar.transform;
            this._behaviorTree    = avatar.GetComponent <BehaviorDesigner.Runtime.BehaviorTree>();
            if (this.slowMode)
            {
                Time.timeScale = 0.25f;
            }
            if (!this.showEffect)
            {
                this._postFX = this._camera.GetComponent <PostFX>();
                this._postFX.UseDistortion = false;
            }
            this._timer    = 0f;
            this.isPlaying = true;
        }
コード例 #3
0
ファイル: Footprint.cs プロジェクト: slb1988/agame
        private void Update()
        {
            if (this._lightForwardTransform == null)
            {
                this._lightForwardTransform = Singleton <StageManager> .Instance.GetStageEnv().lightForwardTransform;

                this._lightDir = this._lightForwardTransform.forward;
            }
            List <BaseMonoAvatar> allAvatars = Singleton <AvatarManager> .Instance.GetAllAvatars();

            for (int i = 0; i < allAvatars.Count; i++)
            {
                BaseMonoAvatar key = allAvatars[i];
                if (key.IsActive() && ((this.zone == null) || this.zone.Contain(key.XZPosition)))
                {
                    State state;
                    if (this._avatarStateDict.ContainsKey(key))
                    {
                        state = this._avatarStateDict[key];
                    }
                    else
                    {
                        state = new State();
                        string avatarTypeName = key.AvatarTypeName;
                        state.setting         = !this._avatarTypeNameSettingDict.ContainsKey(avatarTypeName) ? this._defaultSetting : this._avatarTypeNameSettingDict[avatarTypeName];
                        state.particleSystem  = this._settingParticleSystemDict[state.setting];
                        state.controller      = key.GetComponent <BaseStepController>();
                        state.lastLeftPatten  = BaseStepController.Pattern.Void;
                        state.rightLeftPatten = BaseStepController.Pattern.Void;
                        if (state.controller == null)
                        {
                        }
                        this._avatarStateDict.Add(key, state);
                    }
                    BaseStepController controller = state.controller;
                    if (controller != null)
                    {
                        this.HandleStep(controller.currentLeftStepParam, ref state.lastLeftPatten, state);
                        this.HandleStep(controller.currentRightStepParam, ref state.rightLeftPatten, state);
                    }
                }
            }
        }