Пример #1
0
        public override void Tick()
        {
            base.Tick();

            bool canSee = shouldSee();

            this.SetClass("hidden", !canSee);
            if (!canSee)
            {
                return;
            }

            Angles camAngles = new Angles(0, Time.Now * 100 % 360, 0);
            float  camHeight = (float)(20f + Math.Sin(Time.Now));

            coneScene.SetCamera(camAngles.Normal.Direction * 125 + Vector3.Down * camHeight, camAngles + new Angles(0, -180, 0), 35);
            coneText.Text = $"Please wait {HSGame.Instance.CurrentRound.RoundTime} moments";
        }
Пример #2
0
        public override void Tick()
        {
            base.Tick();

            var player = Local.Pawn as ExtractionPlayer;

            if (player == null)
            {
                return;
            }

            heroText.Text = $"{player.HeroData.Name}";
            CamAngles.yaw = 180;

            if (player.GetActiveAnimator() is ExtractionPlayerAnimator animator)
            {
                // Animation overrides
                animator.Params["lookat_pos"] = new Vector3(10, 0, 0);
                foreach (var animParam in animator.Params)
                {
                    if (animParam.Value is int intAnimValue)
                    {
                        playerPreview.SetAnimParam(animParam.Key, intAnimValue);
                    }
                    else if (animParam.Value is bool boolAnimValue)
                    {
                        playerPreview.SetAnimParam(animParam.Key, boolAnimValue);
                    }
                    else if (animParam.Value is float floatAnimValue)
                    {
                        playerPreview.SetAnimParam(animParam.Key, floatAnimValue);
                    }
                    else if (animParam.Value is Vector3 vector3AnimValue)
                    {
                        playerPreview.SetAnimParam(animParam.Key, vector3AnimValue);
                    }
                }

                CamAngles.yaw = 160;
            }

            playerPreview.Update(Time.Now - startTime);
            sceneCapture?.SetCamera(Vector3.Up * 60 + CamAngles.Direction * -50, CamAngles, 30);
        }
Пример #3
0
        private void LoadWorld()
        {
            DeleteScene();

            using (SceneWorld.SetCurrent(new SceneWorld()))
            {
                playerPreview = new AnimSceneObject(Model.Load(ExtractionConfig.PlayerModel), Transform.Zero);

                Light.Point(Vector3.Up * 150.0f, 200.0f, Color.White * 5000.0f);
                Light.Point(Vector3.Up * 100.0f + Vector3.Forward * 100.0f, 200, Color.White * 15000.0f);

                sceneCapture = SceneCapture.Create("portrait", 256, 256);

                sceneCapture.AmbientColor = new Color(0.8f, 0.8f, 0.8f);
                sceneCapture.SetCamera(Vector3.Up * 100 + CamAngles.Direction * -50, CamAngles, 45);

                // TODO: Clothes

                startTime = Time.Now;
            }
        }