コード例 #1
0
        protected virtual void UpdateTrackables(GameAgent gameAgent)
        {
            // Update the vehicle's team
            Team team = gameAgent == null ? originalTeam : gameAgent.Team;

            // Update the Team for all the trackables on this vehicle
            for (int i = 0; i < trackables.Length; ++i)
            {
                trackables[i].Team = team;
            }

            // Update the label on the root trackable
            if (overrideRootTrackableLabel && rootTrackable != null)
            {
                if (rootTrackable.variablesDictionary.ContainsKey(labelKey))
                {
                    LinkableVariable labelVariable = rootTrackable.variablesDictionary[labelKey];
                    if (labelVariable != null)
                    {
                        labelVariable.StringValue = gameAgent.Label;
                    }
                }
            }
        }