示例#1
0
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#2
0
        public static void Update(this BallTouch touch, Touch partial)
        {
            touch.Team        = partial.Team;
            touch.PlayerName  = partial.PlayerName;
            touch.GameSeconds = partial.GameSeconds;

            if (partial.Location.HasValue)
            {
                touch.Location = partial.Location.Value.ToNumerics();
            }

            if (partial.Normal.HasValue)
            {
                touch.Direction = partial.Normal.Value.ToNumerics();
            }
        }