unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

unity3d learn

问候Unity开发人员! 几个月前,我们在Camouflaj出版了Remastering Republique:The Journey to Unity 5 ,一系列视频,文章和博客文章,在项目过程中分享了我们的经验。 (Greeting Unity developers! A couple months ago we at Camouflaj published Remastering Republique: The Journey to Unity 5, a series of videos, articles and blog posts, sharing our experience thru the course of the project.)

今天,我们通过在Unity Asset Store共享游戏的真实片段,迈出了进一步的一步! 希望这将成为社区的资源,以了解Unity 5的功能以及如何将其应用于实际游戏中。 (Today we’re going one step further by sharing a real slice of our game at the Unity Asset Store! Hopefully, this will act as resource for the community to learn about what’s possible with Unity 5, and how it can be applied this in a real game.)

You’ll find several areas from Republique in this project file: the Brigs, the Atrium, and the Terminus. You’ll also see how we used several out-of-the-box Unity 5 features: Reflection Probes, Enlighten, new Animation and Audio features, and more.

您可以在此项目文件中找到Republique的几个区域:Brigs,Atrium和Terminus。 您还将看到我们如何使用了几个现成的Unity 5功能:反射探针,启发,新的动画和音频功能等等。

Here’s a quick tour to walk through some of the things you’ll find.

这是一个快速导览,以逐步介绍您会发现的一些内容。

开导   (ENLIGHTEN )

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

Republique’s Atrium space was the first thing we tackled as a studio when we moved to Unity 5. Many studios will create a proof of concept by taking a simple, unimpressive space and transforming it using the new technology they’re looking to adopt. We did just the opposite! The Atrium is Episode 1’s hero space, undeniably one of our favorites, and we wanted to be honest with ourselves about what migrating to Unity 5 would do for the highest quality areas. We were pleasantly surprised by the enhancements provided by Enlighten, particularly in the light being cast from the top of the scene.

搬到Unity 5时,Republique的Atrium空间是我们作为工作室处理的第一件事。许多工作室将通过采用简单,不令人印象深刻的空间并使用他们希望采用的新技术对其进行转换来创建概念证明。 我们恰恰相反! 中庭是第1集的英雄空间,不可否认是我们的最爱之一,并且我们想对迁移到Unity 5来实现最高质量的区域诚实。 Enlighten提供的增强功能使我们感到惊喜,特别是从场景顶部投射的光线。

Emissive materials are one of the newest additions to Unity 5. Here you can see that by increasing the Emission intensity of the Fluorescent Light material, you get a much brighter scene with bounce lighting. You will receive instant feedback if you have continuous baking checked. This is a huge time saver when lighting your environment.

发光材料是Unity 5的最新添加之一。在这里您可以看到,通过增加荧光灯材料的发光强度,您可以在反射照明下获得更加明亮的场景。 如果您进行了连续烘烤,您将收到即时反馈。 在照明环境时,这可以节省大量时间。

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

You can see in the material example that the emission value is a new feature, and can easily be animated by adding an Animation track that controls these values.

您可以在材料示例中看到发射值是一个新功能,可以通过添加控制这些值的动画轨道轻松对其进行动画处理。

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!
unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

Here you can see that by increasing the Indirect Intensity in our lighting tab, the scene will dynamically update and become brighter. This, like everything else, is displayed in real time.

在这里,您可以看到通过增加光照选项卡中的间接强度,场景将动态更新并变得更亮。 像其他所有内容一样,这是实时显示的。

Reflection probes allow metals to react more like their real-world counterparts by reflecting the environments around them. If you check Box projections, these more accurately reflect the geo around them, provided the scene is a square shape.

反射探针可使金属反射周围的环境,从而使其React更像现实世界中的金属。 如果选中“框投影”,则只要场景为正方形,这些投影就可以更准确地反映周围的地理位置。

Here you can see that if we take the pillar and set the surface of the material to metal and increase the reflectivity, you get a spatially accurate reflection.

在这里,您可以看到,如果我们拿起Struts并将材料的表面设置为金属并增加反射率,则会获得空间精确的反射。

Likewise, as you decrease the smoothness, the reflection will become rough or blurry.

同样,随着平滑度的降低,反射会变得粗糙或模糊。

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

团结5音频 (UNITY 5 AUDIO)

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

Unity 5’s Audio Mixer allows you to categorize audio and specify output buses to allow for more flexibility in how audio is routed and mixed, as well as how effects are applied. In the ‘Ambience’ group, ‘Ambience’ is split into 2D and 3D sub-groups. Naturally, 3D ambient audio is routed to the 3D sub-group, so that the audio associated within the 3D bus fire appropriately relative to their grouping. Within each group, the volume and pitch can be adjusted, audio filters can be applied and tweaked, and you can solo or mute individual or entire groups in real-time. Just be sure to click on ‘Edit in Play Mode’ on the top right corner of the Audio Mixer while the game is running. As an example, we’ve added ‘SFX Reverb’ to the Footsteps group for you to tweak and play around with while the game is running.

Unity 5的音频混合器可让您对音频进行分类并指定输出总线,从而在音频的路由和混合方式以及效果的应用方式上提供更大的灵活性。 在“环境”组中,“环境”分为2D和3D子组。 自然地,将3D环境音频路由到3D子组,以便3D总线内关联的音频相对于其分组适当触发。 在每个组中,可以调节音量和音调,可以应用和调整音频滤波器,并且可以实时单独或单个组或整个组静音。 只需在游戏运行时单击音频混合器右上角的“在播放模式下编辑”即可。 例如,我们在“足迹”组中添加了“ SFX混响”,以便您在游戏运行时进行调整和试玩。

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

Once you’re satisfied with how the mix is turning out, you can save a Snapshot of your Audio Mixer settings. Snapshots are very useful in preserving your mix, as well as allowing you to create multiple sound profiles, paving the way for a more dynamic mix.

对混音的效果满意后,可以保存音频混音器设置的快照。 快照在保留混音方面非常有用,并允许您创建多个声音配置文件,从而为更动态的混音铺平了道路。

麦卡尼姆 (MECANIM)

When you’re ready to press play and give the game a shot, you can left click to move Hope around the environment, and use WASD to control the camera. We’ve included several animations, but since we are exposing the Mecanim API, you will be able to create all sorts of tools to create and edit Mecanim assets.

准备好按播放并试玩游戏时,可以单击鼠标左键以在整个环境中移动Hope,然后使用WASD控制摄像机。 我们已经包含了几个动画,但是由于我们要公开Mecanim API,因此您将能够创建各种工具来创建和编辑Mecanim资产。

unity3d learn_Unity 5 Learn Project中的Republique Remastered在这里!

In this project, there is a button to re-create the Animator used on Hope 1 click. The script creates a similar Animator in the Project folder. The code for the creation of the controller is as simple as it gets:

在此项目中,有一个按钮可以重新创建在Hope 1单击上使用的Animator。 该脚本在Project文件夹中创建一个类似的Animator。 创建控制器的代码非常简单:

[MenuItem (“Hope/Create Controller”)]

[MenuItem(“希望/创建控制器”))

static void CreateController () {

静态void CreateController(){

<i>// Creates the controller</i>

<i> //创建控制器</ i>

var controller = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath (“Assets/HopeScriptCtrl.controller”);

var controller = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath(“资产/HopeScriptCtrl.controller”);

<i>// Add parameters</i>

<i> //添加参数</ i>

controller.AddParameter(“Walk”, AnimatorControllerParameterType.Bool);

controller.AddParameter(“ Walk”,AnimatorControllerParameterType.Bool);

controller.AddParameter(“TurnLeft”, AnimatorControllerParameterType.Bool);

controller.AddParameter(“ TurnLeft”,AnimatorControllerParameterType.Bool);

controller.AddParameter(“TurnRight”, AnimatorControllerParameterType.Bool);

controller.AddParameter(“ TurnRight”,AnimatorControllerParameterType.Bool);

controller.AddParameter(“HalfTurn”, AnimatorControllerParameterType.Bool);

controller.AddParameter(“ HalfTurn”,AnimatorControllerParameterType.Bool);

<i>// Add StateMachines</i>

<i> //添加StateMachines </ i>

var rootStateMachine = controller.layers[0].stateMachine;

var rootStateMachine = controller.layers [0] .stateMachine;

var stateMachineStand = rootStateMachine.AddStateMachine(“Stand”);

var stateMachineStand = rootStateMachine.AddStateMachine(“ Stand”);

<i>// Add States</i>

<i> //添加状态</ i>

var stateIdle = stateMachineStand.AddState(“Idle”);

var stateIdle = stateMachineStand.AddState(“ Idle”);

var stateTurnLeft = stateMachineStand.AddState(“TurnLeft”);

var stateTurnLeft = stateMachineStand.AddState(“ TurnLeft”);

var stateTurnRight = stateMachineStand.AddState(“TurnRight”);

var stateTurnRight = stateMachineStand.AddState(“ TurnRight”);

var stateHalfTurn = stateMachineStand.AddState(“HalfTurn”);

var stateHalfTurn = stateMachineStand.AddState(“ HalfTurn”);

var stateWalk = stateMachineStand.AddState(“Walk”);

var stateWalk = stateMachineStand.AddState(“ Walk”);

stateIdle.motion = AssetDatabase.LoadAssetAtPath(“Assets/Animations/Hope Animations/StandingIdleLooking.fbx”, typeof(AnimationClip)) as Motion;

stateIdle.motion = AssetDatabase.LoadAssetAtPath(“资产/动画/希望动画/StandingIdleLooking.fbx”,typeof(AnimationClip))为Motion;

stateTurnLeft.motion = AssetDatabase.LoadAssetAtPath(“Assets/Animations/Hope Animations/MoveStand90_L.fbx”, typeof(AnimationClip)) as Motion;

stateTurnLeft.motion = AssetDatabase.LoadAssetAtPath(“资产/动画/希望动画/MoveStand90_L.fbx”,typeof(AnimationClip))为Motion;

stateTurnRight.motion = AssetDatabase.LoadAssetAtPath(“Assets/Animations/Hope Animations/MoveStand90_R.fbx”, typeof(AnimationClip)) as Motion;

stateTurnRight.motion = AssetDatabase.LoadAssetAtPath(“资产/动画/希望动画/MoveStand90_R.fbx”,typeof(AnimationClip))为Motion;

stateHalfTurn.motion = AssetDatabase.LoadAssetAtPath(“Assets/Animations/Hope Animations/MoveStand180.fbx”, typeof(AnimationClip)) as Motion;

stateHalfTurn.motion = AssetDatabase.LoadAssetAtPath(“资产/动画/希望动画/MoveStand180.fbx”,typeof(AnimationClip))为Motion;

stateWalk.motion = AssetDatabase.LoadAssetAtPath(“Assets/Animations/Hope Animations/MoveWalk_F.fbx”, typeof(AnimationClip)) as Motion;

stateWalk.motion = AssetDatabase.LoadAssetAtPath(“资产/动画/希望动画/MoveWalk_F.fbx”,typeof(AnimationClip))为Motion;

<i>// Add Transitions</i>

<i> //添加过渡</ i>

var idle2TurnLeft = stateIdle.AddTransition (stateTurnLeft);

var idle2TurnLeft = stateIdle.AddTransition(stateTurnLeft);

var turnLeft2Idle = stateTurnLeft.AddTransition (stateIdle);

var turnLeft2Idle = stateTurnLeft.AddTransition(stateIdle);

idle2TurnLeft.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, “TurnLeft”);

idle2TurnLeft.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If,0,“ TurnLeft”);

idle2TurnLeft.duration = 0.025f;

idle2TurnLeft.duration = 0.025f;

turnLeft2Idle.hasExitTime = true;

turnLeft2Idle.hasExitTime = true;

turnLeft2Idle.exitTime = 0.85f;

turnLeft2Idle.exitTime = 0.85f;

turnLeft2Idle.duration = 0.15f;

turnLeft2Idle.duration = 0.15f;

var idle2TurnRight = stateIdle.AddTransition (stateTurnRight);

var idle2TurnRight = stateIdle.AddTransition(stateTurnRight);

var turnRight2Idle = stateTurnRight.AddTransition (stateIdle);

var turnRight2Idle = stateTurnRight.AddTransition(stateIdle);

idle2TurnRight.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, “TurnRight”);

idle2TurnRight.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If,0,“ TurnRight”);

idle2TurnRight.duration = 0.025f;

idle2TurnRight.duration = 0.025f;

turnRight2Idle.hasExitTime = true;

turnRight2Idle.hasExitTime = true;

turnRight2Idle.exitTime = 0.85f;

turnRight2Idle.exitTime = 0.85f;

turnRight2Idle.duration = 0.15f;

turnRight2Idle.duration = 0.15f;

var idle2HalfTurn = stateIdle.AddTransition (stateHalfTurn);

var idle2HalfTurn = stateIdle.AddTransition(stateHalfTurn);

var halfTurn2Idle = stateHalfTurn.AddTransition (stateIdle);

var halfTurn2Idle = stateHalfTurn.AddTransition(stateIdle);

idle2HalfTurn.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, “HalfTurn”);

idle2HalfTurn.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If,0,“ HalfTurn”);

idle2HalfTurn.duration = 0.025f;

idle2HalfTurn.duration = 0.025f;

halfTurn2Idle.hasExitTime = true;

halfTurn2Idle.hasExitTime = true;

halfTurn2Idle.exitTime = 0.85f;

halfTurn2Idle.exitTime = 0.85f;

halfTurn2Idle.duration = 0.15f;

halfTurn2Idle.duration = 0.15f;

var idle2Walk = stateIdle.AddTransition (stateWalk);

var idle2Walk = stateIdle.AddTransition(stateWalk);

var walk2Idle = stateWalk.AddTransition (stateIdle);

var walk2Idle = stateWalk.AddTransition(stateIdle);

idle2Walk.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If, 0, “Walk”);

idle2Walk.AddCondition(UnityEditor.Animations.AnimatorConditionMode.If,0,“ Walk”);

idle2Walk.duration = 0.025f;

idle2Walk.duration = 0.025f;

walk2Idle.AddCondition(UnityEditor.Animations.AnimatorConditionMode.IfNot, 0, “Walk”);

walk2Idle.AddCondition(UnityEditor.Animations.AnimatorConditionMode.IfNot,0,“步行”);

walk2Idle.duration = 0.25f;

walk2Idle.duration = 0.25f;

}

}

And so ends our summary of the Republique Remastered in Unity 5 Learn Project! We hope you find our project useful, and we inspired you to experiment and learn more on your own. Best of luck from all of us at Camouflaj!

至此,我们总结了在Unity 5学习项目中重新制作的共和国的摘要! 我们希望您发现我们的项目有用,并且启发您自己尝试和了解更多信息。 祝大家好运,在Camouflaj!

 *NOTE: Visual fidelity of project file may differ slightly from the retail version of Republique Remastered.

  *注意:项目文件的视觉保真度可能与Republique Remastered的零售版略有不同。

翻译自: https://blogs.unity3d.com/2015/04/17/the-republique-remastered-in-unity-5-learn-project-is-here/

unity3d learn