public override void OnInspectorGUI() { dusmankontrol script = (dusmankontrol)target; EditorGUILayout.Space(); if (GUILayout.Button("ÜRET", GUILayout.MinWidth(100), GUILayout.Width(100))) { GameObject yeniobjen = new GameObject(); yeniobjen.transform.parent = script.transform; yeniobjen.transform.position = script.transform.position; yeniobjen.name = script.transform.childCount.ToString(); } EditorGUILayout.Space(); EditorGUILayout.PropertyField(serializedObject.FindProperty("layermask")); EditorGUILayout.PropertyField(serializedObject.FindProperty("onTaraf")); EditorGUILayout.PropertyField(serializedObject.FindProperty("arkaTaraf")); EditorGUILayout.PropertyField(serializedObject.FindProperty("kursun")); serializedObject.ApplyModifiedProperties(); serializedObject.Update(); }
void Start() { dusman = GameObject.FindGameObjectWithTag("dusman").GetComponent <dusmankontrol>(); fizik = GetComponent <Rigidbody2D>(); fizik.AddForce(dusman.getYon() * 1000); }