// 仅限于瞄镜的变化
        public void RefreshRemovableAttachment(GameObject go, bool hasSights)
        {
            var ironSights = BoneMount.FindChildBoneFromCache(go, BoneName.RemovableIronSights);
            var rail       = BoneMount.FindChildBoneFromCache(go, BoneName.RemovableRail);

            if (ironSights != null)
            {
                if (hasSights)
                {
                    AppearanceUtils.DisableRender(ironSights.gameObject);
                }
                else
                {
                    AppearanceUtils.EnableRender(ironSights.gameObject);
                }
            }

            if (rail != null)
            {
                if (hasSights)
                {
                    AppearanceUtils.EnableRender(rail.gameObject);
                }
                else
                {
                    AppearanceUtils.DisableRender(rail.gameObject);
                }
            }
        }
 private void DisableRender(GameObject go)
 {
     if (_enabled)
     {
         AppearanceUtils.DisableRender(go);
     }
 }
Beispiel #3
0
        public void SetFirstPersonCharacter(GameObject obj)
        {
            _weaponController.SetFirstPersonCharacter(obj);
            _wardrobeController.SetFirstPersonCharacter(obj);
            _propController.SetFirstPersonCharacter(obj);

            _characterP1 = obj;
            AppearanceUtils.DisableRender(_characterP1);
        }
Beispiel #4
0
        public void SetFirstPersonCharacter(GameObject obj)
        {
            WeaponControllerBaseImpl.SetFirstPersonCharacter(obj);
            WardrobeControllerBaseImpl.SetFirstPersonCharacter(obj);
            PropControllerBaseImpl.SetFirstPersonCharacter(obj);

            _characterP1 = obj;
            AppearanceUtils.DisableRender(_characterP1);
        }
Beispiel #5
0
 public void SetThirdPerson()
 {
     if (FirstPersonIncluded)
     {
         AppearanceUtils.DisableRender(_propObjP1);
     }
     if (ThirdPersonIncluded)
     {
         AppearanceUtils.EnableRender(_propObjP3);
     }
     _view = CharacterView.ThirdPerson;
 }
        public void SetFirstPersonCharacter(GameObject obj)
        {
            WeaponControllerBaseImpl.SetRootGo(_rootGo);

            WeaponControllerBaseImpl.SetFirstPersonCharacter(obj);
            WardrobeControllerBaseImpl.SetFirstPersonCharacter(obj);
            PropControllerBaseImpl.SetFirstPersonCharacter(obj);

            _characterP1 = obj;
            AppearanceUtils.DisableRender(_characterP1);

            WardrobeControllerBaseImpl.SetRootGo(_rootGo);
            Logger.ErrorFormat("first ApperanceBaseRootGo: " + _rootGo);
        }
Beispiel #7
0
        private void RemovePropInHand()
        {
            if (ThirdPersonIncluded && null != _propObjP3)
            {
                _mount.RemountWeaponOnRightHand(_propObjP3, _characterP3);
                AppearanceUtils.DisableRender(_propObjP3);
            }

            if (FirstPersonIncluded && null != _propObjP1)
            {
                _mount.RemountWeaponOnRightHand(_propObjP1, _characterP1);
                AppearanceUtils.DisableRender(_propObjP1);
                ResetPropsShader(_propObjP1);
            }
        }
 public void Hide()
 {
     _enabled = false;
     for (var i = 0; i < (int)Wardrobe.EndOfTheWorld; i++)
     {
         var param = _wardrobes[i];
         if (param != null)
         {
             if (_wardrobesStatus.GetDefaultEnabled((Wardrobe)i))
             {
                 AppearanceUtils.DisableRender(param.DefaultGameObject);
             }
             if (_wardrobesStatus.GetAlterEnabled((Wardrobe)i))
             {
                 AppearanceUtils.DisableRender(param.AlternativeGameObject);
             }
         }
     }
 }
        private void FinishLoadResource(WardrobeParam param, int index)
        {
            if (index == _p1Index && FirstPersonIncluded)
            {
                if (IsFirstPerson)
                {
                    AppearanceUtils.EnableRender(param.DefaultGameObject);
                    AppearanceUtils.EnableRender(param.AlternativeGameObject);
                }
                else
                {
                    AppearanceUtils.DisableRender(param.DefaultGameObject);
                    AppearanceUtils.DisableRender(param.AlternativeGameObject);
                }

                AppearanceUtils.DisableShadow(param.DefaultGameObject);
                AppearanceUtils.DisableShadow(param.AlternativeGameObject);

                _p1Avatar.AddWardrobe(param);
                UpdateRenderBelowAnimatorP1();
            }

            if (index == _p3Index && ThirdPersonIncluded)
            {
                if (IsFirstPerson)
                {
                    AppearanceUtils.DisableRender(param.DefaultGameObject);
                    AppearanceUtils.DisableRender(param.AlternativeGameObject);
                }
                else
                {
                    AppearanceUtils.EnableRender(param.DefaultGameObject);
                    AppearanceUtils.EnableRender(param.AlternativeGameObject);
                }

                _p3Avatar.AddWardrobe(param);
                UpdateRenderBelowAnimatorP3();
            }

            ChangeWardrobeShader(param.DefaultGameObject, index);
            ChangeWardrobeShader(param.AlternativeGameObject, index);
        }
        public override void DoAction(IEventArgs args)
        {
            IGameUnit unit = GetPlayer(args);

            if (unit != null)
            {
                PlayerEntity player = ((FreeData)unit).Player;

                if (FreeUtil.ReplaceBool(show, args))
                {
                    AppearanceUtils.EnableRender(player.thirdPersonModel.Value);
                    player.gamePlay.GameState = GameState.Visible;
                }
                else
                {
                    AppearanceUtils.DisableRender(player.thirdPersonModel.Value);
                    player.gamePlay.GameState = GameState.Invisible;
                }
            }
        }
Beispiel #11
0
 public void OnGamePlay()
 {
     foreach (PlayerEntity player in _contexts.player.GetEntities())
     {
         if (player.gamePlay.GameState == GameState.Invisible)
         {
             if (player.gamePlay.ClientState != GameState.Invisible)
             {
                 AppearanceUtils.DisableRender(player.thirdPersonModel.Value);
                 player.gamePlay.ClientState = GameState.Invisible;
             }
         }
         if (player.gamePlay.GameState == GameState.Visible)
         {
             if (player.gamePlay.ClientState == GameState.Invisible)
             {
                 AppearanceUtils.EnableRender(player.thirdPersonModel.Value);
                 player.gamePlay.ClientState = GameState.Normal;
             }
         }
     }
 }
Beispiel #12
0
            public void OnLoadSuccess <T>(T source, UnityObject unityObj)
            {
                var go = unityObj.AsGameObject;

                if (null == go)
                {
                    return;
                }

                BoneTool.CacheTransform(go);

                if (_dataSource._p1Index == _index)
                {
                    AppearanceUtils.DisableRender(_dataSource._propObjP1);
                    _dataSource._propObjP1 = go;
                    if (!_dataSource.IsFirstPerson)
                    {
                        AppearanceUtils.DisableRender(go);
                        _dataSource.AddRecycleObject(unityObj);
                    }
                }
                else if (_dataSource._p3Index == _index)
                {
                    AppearanceUtils.DisableRender(_dataSource._propObjP3);
                    _dataSource._propObjP3 = go;
                    if (_dataSource.IsFirstPerson)
                    {
                        AppearanceUtils.DisableRender(go);
                        _dataSource.AddRecycleObject(unityObj);
                    }
                }
                else
                {
                    AppearanceUtils.DisableRender(go);
                    _dataSource.AddRecycleObject(unityObj);
                }

                _dataSource.MountPropToHand(_index);
            }
Beispiel #13
0
 private void Hide()
 {
     AppearanceUtils.DisableRender(Weapon.PrimaryAsGameObject);
     AppearanceUtils.DisableRender(Weapon.DeputyAsGameObject);
 }
 private void Hide()
 {
     AppearanceUtils.DisableRender(Attachment);
 }