Exemplo n.º 1
0
    override public void OnInspectorGUI()
    {
        serializedObject.Update();
        BossBody_SCR bossScript = target as BossBody_SCR;


        showDefault = EditorGUILayout.Toggle("Show default options", showDefault);
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        if (showDefault)
        {
            DrawDefaultInspector();
        }
        else
        {
            if (bossScript.healthBar == null)
            {
                bossScript.healthBar = EditorGUILayout.ObjectField("Health bar", bossScript.healthBar, typeof(GameObject), false) as GameObject;
            }

            bossScript.currHealth = EditorGUILayout.FloatField("Current Health", bossScript.currHealth);
            bossScript.maxHealth  = EditorGUILayout.FloatField("Max Health", bossScript.maxHealth);

            bossScript.movementSpeed = EditorGUILayout.FloatField("Movement Speed", bossScript.movementSpeed);
        }

        // Save all changes
        EditorUtility.SetDirty(target);
        EditorUtility.SetDirty(this);
        EditorUtility.SetDirty(bossScript);
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     god        = GameObject.Find("God").GetComponent <God_SCR>();
     pathfinder = god.GetComponent <Pathfinder_SCR>();
     body       = this.GetComponent <BossBody_SCR>();
     moving     = false;
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     body     = this.GetComponent <BossBody_SCR>();
     lowBrain = this.GetComponent <LowLevelAI_SCR>();
 }