void Workspace_NodeChanged() { BeginInvokeOnMainThread(() => { solidNode.RemoveFromParentNode(); solidNode = workspace.Node; var c = SCNVector3.Zero; nfloat r = 1.0f; solidNode.GetBoundingSphere(ref c, ref r); scene.RootNode.Add(solidNode); cameraNode.Camera.YFov = 60; cameraNode.Position = new SCNVector3(0, 0, (float)r * 2.5f); }); }
public void SetProjectileType(ProjectileType projectileType, SCNNode projectile) { this.Projectile?.RemoveFromParentNode(); this.Projectile = projectile; this.ProjectileType = projectileType; this.projectileScale = projectile.Scale; // the rope adjusts to the radius of the ball var projectilePaddingScale = 1f; nfloat radius = 0f; var temp = SCNVector3.Zero; projectile.GetBoundingSphere(ref temp, ref radius); this.rope.SetBallRadius((float)radius * projectilePaddingScale); // need ball to set a teamID, and then can color with same mechanism //projectile.setPaintColor() // will be made visible and drop when cooldown is exceeded, // this way ball doesn't change suddenly while visible this.BallVisible = BallVisible.Hidden; this.UpdateFakeProjectileVisibility(); }