Пример #1
0
        public void WeaponCremaShake(FrameEventInfo.CameraShakeType cameraShakeType = FrameEventInfo.CameraShakeType.None)
        {
            ConstrainedCamera constrainedCamera = Camera.main.GetComponent <ConstrainedCamera>();

            switch (cameraShakeType)
            {
            case FrameEventInfo.CameraShakeType.CameraShake:
                constrainedCamera.Shake(1f, 1f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.LswdCameraShake:
                constrainedCamera.Shake(0.3f, 0.4f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.LswdCameraShakefierce:
                constrainedCamera.Shake(0.5f, 0.7f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.SwdCameraShake:
                constrainedCamera.Shake(0.3f, 0.2f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.SwdCameraShakefierce:
                constrainedCamera.Shake(0.5f, 0.5f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.None:
                // constrainedCamera.Shake(0.3f, 0.2f, 50, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.smallshape:
                constrainedCamera.Shake(0.2f, 0.5f, 100, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.mediumshape:
                constrainedCamera.Shake(0.2f, 1f, 100, 90f, false, true);
                break;

            case FrameEventInfo.CameraShakeType.bigshape:
                constrainedCamera.Shake(0.2f, 1.5f, 100, 90f, false, true);
                break;

            default:
                break;
            }
        }
Пример #2
0
        RoleController CreatePlayer1(PlayerData playerData = null)
        {
            playerPrefabName = playerPrefabName == null ? "Human" : playerPrefabName;
            playerPrefabName = playerPrefabName == "" ? "Human" : playerPrefabName;

            GameObject role = GameObjectManager.Instance.Create(playerPrefabName ?? "Human");

            role.name = "Player1";
            role.tag  = "Player";

            role.AddComponentUnique <Player1InputController>();
            var roleController = role.GetComponent <RoleController>();

            var roleBehaviorTree  = role.GetComponent <RoleBehaviorTree>();
            var behaviorTree      = role.GetComponent <BehaviorDesigner.Runtime.BehaviorTree>();
            var InteractiveCube   = role.GetChild("InteractiveCube");
            var triggercontroller = InteractiveCube.GetComponent <TriggerController>();

            triggercontroller.needKeepingGameObject = true;
            if (roleBehaviorTree != null)
            {
                Tools.Destroy(roleBehaviorTree);
            }

            if (behaviorTree != null)
            {
                Tools.Destroy(behaviorTree);
            }
            roleController._withAI = false;

            if (false && // 不读档 add by TangJian 2018/9/21 0:03
                playerData != null && playerData.currRoleData != null)
            {
                roleController.RoleData        = playerData.currRoleData;
                roleController.RoleData.TeamId = "1";

                //roleController.RoleData.EquipData.MainHand = ItemManager.Instance.getItemDataById<WeaponData>("swd-1");
                //roleController.RoleData.EquipData.OffHand = ItemManager.Instance.getItemDataById<WeaponData>("swd-1");

                //roleController.RoleData.EquipData.SoulData = ItemManager.Instance.getItemDataById<SoulData>("Soul-FireBall");
            }

            if (this.player1Data != null)
            {
                roleController.RoleData = this.player1Data;
            }

            ConstrainedCamera constrainedCamera = Camera.main.GetComponent <ConstrainedCamera>();

            constrainedCamera.Player1 = role.transform;

            // 与npc交互
            roleController.OnInteractAction = (GameObject gameObject) =>
            {
                if (gameObject.tag == "NPC")
                {
                    choiceBubbleController = GameObject.Find("choicebubble").GetComponent <ChoiceBubbleController>();
                    fsm.SendEvent("AllToTalk");
                }
            };

            roleController.PickupConsumable = () =>
            {
                gamingUIController.RefreshGlist();
            };

            roleController.OnDying += (RoleController _roleController) =>
            {
                // 掉装备 add by TangJian 2019/3/14 11:45
                Debug.Log("掉装备");
            };

            return(roleController);
        }
Пример #3
0
        public void ShakeV3(float duration, Vector3 strength = new Vector3(), int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true)
        {
            ConstrainedCamera constrainedCamera = Camera.main.GetComponent <ConstrainedCamera>();

            constrainedCamera.ShakeV3(duration, strength, vibrato, randomness, snapping, fadeOut);
        }