public NameTag3D(string displayString, Color displayColor, Font displayFont, Transform followTransform, IScheduler scheduler) { if (displayFont == null) { throw new ArgumentNullException("displayFont"); } if (followTransform == null) { throw new ArgumentNullException("followTransform"); } if (scheduler == null) { throw new ArgumentNullException("scheduler"); } mScheduler = scheduler; mFollowTransform = followTransform; // Create a Text3D Object for the name mName = new Text3D(displayFont); mName.Visible = false; mName.Scale = new Vector3(mScale, mScale, mScale); mName.Color = Color.white; DisplayString = displayString; // Create a Billboard Object for background mBackground = new Billboard(); mBackground.Visible = false; mBackground.Color = displayColor; mBackground.SetTexture((Texture2D)Resources.Load("GUI/TopLevel/frame_white_5px_slice")); mUpdateTagPositionTask = mScheduler.StartCoroutine(UpdateTagPosition()); }
public void Dispose() { mUpdateTagPositionTask.Exit(); mName.Dispose(); mName = null; mBackground.Dispose(); mBackground = null; }