Exemplo n.º 1
0
        /// <summary>
        /// Creates a KinematicCharacterSystem instance if there isn't already one
        /// </summary>
        public static void EnsureCreation()
        {
            if (_instance == null)
            {
                GameObject systemGameObject = new GameObject("KinematicCharacterSystem");
                _instance = systemGameObject.AddComponent <KinematicCharacterSystem>();

                systemGameObject.hideFlags = HideFlags.NotEditable;
                _instance.hideFlags        = HideFlags.NotEditable;
            }
        }
Exemplo n.º 2
0
 private void OnDisable()
 {
     KinematicCharacterSystem.UnregisterPhysicsMover(this);
 }
Exemplo n.º 3
0
 private void OnEnable()
 {
     KinematicCharacterSystem.EnsureCreation();
     KinematicCharacterSystem.RegisterPhysicsMover(this);
 }
Exemplo n.º 4
0
 private void Awake()
 {
     _instance = this;
 }