void Awake() { controller = GetComponent<ControllerComponent> (); jumper = GetComponent<JumpComponent> (); animator = GetComponent<Animator> (); attacker = GetComponent<AttackComponent> (); }
protected void Start() { _controller = gameObject.GetComponent <ControllerComponent>(); CurrentCamera = gameObject.GetComponent <Camera>(); gameObject.transform.parent = _controller.PawnInstance.transform; }
public override void UpdateMatrices() { ControllerComponent.UpdateNode(); Constrain(); SetWorldToCameraMatrix(); SetProjectionMatrix(); }
private ControllerComponent GetController() { if (_cachedController == null) { _cachedController = GameModeComponent.RegisteredGameMode.ActiveController; } return(_cachedController); }
static void Main(string[] args) { ViewComponent view = new ViewComponent(); Balance model = new Balance(); ControllerComponent controller = new ControllerComponent(view, model); controller.DoActions(); }
protected override void OnStart() { var character = _transformingInfo.Owner.GetComponent <CharacterComponent>(); if (character != null) { _owningController = character.ActiveController; DropHeldItem(); CreateNewCharacter(); } }
private void OnNewControllerSet(ControllerComponent inNewController) { _activeController = inNewController; var musicComponent = gameObject.GetComponent <PlayerMusicComponent>(); if (musicComponent != null) { if (ActiveController != null) { musicComponent.MusicAudioSource = ActiveController.GetComponent <AudioSource>(); } } }
public override void OnInspectorGUI() { serializedObject.Update(); ControllerComponent t = (ControllerComponent)target; int autoClearInetrval = (int)EditorGUILayout.Slider("Auto Clear Inetrval", m_AutoClearInetrval.floatValue, 10, 180); if (autoClearInetrval != m_AutoClearInetrval.floatValue) { if (EditorApplication.isPlaying) { t.AutoClearInetrval = autoClearInetrval; } else { m_AutoClearInetrval.floatValue = autoClearInetrval; } } serializedObject.ApplyModifiedProperties(); if (!EditorApplication.isPlaying) { EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info); return; } if (PrefabUtility.GetPrefabType(t.gameObject) != PrefabType.Prefab) { EditorGUILayout.LabelField("AnimatorController Count", t.ControllerInfos.Count.ToString()); EditorGUILayout.BeginVertical("box"); { foreach (var controllerInfos in t.ControllerInfos) { EditorGUILayout.BeginVertical("box"); { EditorGUILayout.LabelField("Animator Owner", controllerInfos.Key == null ? "Empty" : controllerInfos.Key.gameObject.name); EditorGUILayout.LabelField("RuntimeAnimatorController", controllerInfos.Key == null ? "Empty" : controllerInfos.Value.Name); } EditorGUILayout.EndVertical(); } } EditorGUILayout.EndVertical(); } serializedObject.ApplyModifiedProperties(); //重绘面板 Repaint(); }
protected override void Init() { ControllerCachedComponent.TryInit(this); ControllerComponent.InitNode(); WorldToCameraMatrix = Matrix4x4d.identity; CameraToWorldMatrix = Matrix4x4d.identity; CameraToScreenMatrix = Matrix4x4d.identity; ScreenToCameraMatrix = Matrix4x4d.identity; WorldCameraPosition = Vector3d.zero; CameraDirection = Vector3d.zero; worldPosition = Vector3d.zero; Constrain(); }
private void add(ControllerComponent controller) { controllers_.Add(controller); controller.linkInput(); }
private void remove(ControllerComponent controller) { controller.unlinkInput(); controllers_.Remove(controller); }
public void SetActiveController(ControllerComponent inController) { ActiveController = inController; }