private void Start() { if (TopDownCharacterManager.instance == null || TopDownCharacterManager.instance.defaultCharacter == null) { if (GameObject.FindGameObjectWithTag("Player")) { td_Target = GameObject.FindGameObjectWithTag("Player").transform; if (td_Target.GetComponent <TopDownControllerInteract>()) { targetInteractScript = td_Target.GetComponent <TopDownControllerInteract>(); } } else { Debug.LogWarning("No player character found in scene."); } } td_InputManager = TopDownInputManager.instance; td_UiManager = TopDownUIManager.instance; Vector3 angles = transform.eulerAngles; x = angles.x; y = angles.y; if (td_Target != null) { characterSize = td_Target.localScale.x; distanceDefault = distanceDefault * characterSize; } }
public void OnEnable() { td_target = (TopDownInputManager)target; if (TopDownIcon == null) { TopDownIcon = Resources.Load("TopDownIcon") as Texture; } }
private void Start() { td_CheckUI = TopDownCheckUI.instance; tdcc_Main = GetComponent <TopDownControllerMain>(); tdcc_NavMeshAgent = GetComponent <NavMeshAgent>(); tdcc_InputManager = TopDownInputManager.instance; tdcc_EquipmentManager = GetComponent <TopDownEquipmentManager>(); tdr_Spellcaster = GetComponent <TopDownRpgSpellcaster>(); if (GameObject.FindGameObjectWithTag("MainCamera")) { tdcc_CameraMain = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); } else if (GameObject.FindObjectOfType <Camera>()) { tdcc_CameraMain = GameObject.FindObjectOfType <Camera>(); } }
void Start() { tdcm_animator = GetComponent <Animator>(); tdcm_rigidbody = GetComponent <Rigidbody>(); tdcm_Capsule = GetComponent <CapsuleCollider>(); tdcm_NavMeshAgent = GetComponent <NavMeshAgent>(); tdcm_InputManager = TopDownInputManager.instance; if (GameObject.FindGameObjectWithTag("MainCamera")) { tdcm_Camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); } else if (GameObject.FindObjectOfType <Camera>()) { tdcm_Camera = GameObject.FindObjectOfType <Camera>(); } if (tdcm_rigidbody != null) { tdcm_rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; } if (GetComponentInChildren <WindZone>()) { vegetationMoveWindZone = GetComponentInChildren <WindZone>(); } }
private void Awake() { instance = this; }