December 2018
Intermediate to advanced
416 pages
10h 30m
English
The Death component that we are about to add has the same template as the Rotator component that we created in the last section. Let's add it by going through the following steps and taking a look at the code:
using Urho; using System; namespace WhackABox { public class Death : Component { private float deathTtl = 1f; private float initialScale = 1; public Action OnDeath { get; set; } public Death() { ReceiveSceneUpdates = true; } public override void OnAttachedToNode(Node node) { initialScale = node.Scale.X; } protected override void OnUpdate(float timeStep) { Node.SetScale(deathTtl * initialScale); ...Read now
Unlock full access