예제 #1
0
    public override void OnInspectorGUI()
    {
        EnemyWizard script = (EnemyWizard)target;

        if (GUILayout.Button("Generate"))
        {
            GameObject newObject = new GameObject();
            newObject.transform.parent   = script.transform; //gameobject enemies parentinin childi olarak olusturuluyor
            newObject.transform.position = script.transform.position;
            newObject.name = script.transform.childCount.ToString();
        }

        EditorGUILayout.PropertyField(serializedObject.FindProperty("layermask"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("spell"));


        serializedObject.ApplyModifiedProperties();
        serializedObject.Update();
    }
 void Start()
 {
     EnemyWizard = GameObject.FindGameObjectWithTag("EnemyWizard").GetComponent <EnemyWizard>();
     physics     = GetComponent <Rigidbody2D>();
     physics.AddForce(EnemyWizard.GetDirection() * 1000);
 }
 public spellControl(EnemyWizard enemyWizard)
 {
     this.EnemyWizard = enemyWizard;
 }