void Start()
 {
     summon = Manager.manager.summoner;
     Wait();
     StartCoroutine("Pode");
     //Combate();
 }
 void Start()
 {
     lifeMax = life;
     summon = Manager.manager.summoner;
     Wait();
     StartCoroutine("Pode");
     StartCoroutine("Regen");
     //Combate();
 }
Exemple #3
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update(); //Update serialized object's representation.

        SpriteRowCreator myScript = (SpriteRowCreator)target;

        myScript.isRuntime = EditorGUILayout.Toggle("Is Runtime", myScript.isRuntime);

        //Creation Type
        myScript.rowCreatorOptions = (RowCreatorOptions)EditorGUILayout.EnumPopup("Creation type:", myScript.rowCreatorOptions);

        //StartTerminator
        myScript.hasStartTerminator = EditorGUILayout.Toggle("Start Terminator", myScript.hasStartTerminator);
        if (myScript.hasStartTerminator)
        {
            EditorGUILayout.PropertyField(startSpriteToBeCreated, true);
        }

        //EndTerminator
        myScript.hasEndTerminator = EditorGUILayout.Toggle("End Terminator", myScript.hasEndTerminator);
        if (myScript.hasEndTerminator)
        {
            EditorGUILayout.PropertyField(endSpriteToBeCreated, true);
        }

        //How many sprites will be created
        myScript.howMany = EditorGUILayout.IntField("How many:", myScript.howMany);

        //Creation Type variables
        switch (myScript.rowCreatorOptions)
        {
        case RowCreatorOptions.fixedDistance:
            myScript.distance = EditorGUILayout.FloatField("Distance:", myScript.distance);
            break;

        case RowCreatorOptions.variableDistance:
            myScript.minDistance = EditorGUILayout.FloatField("Min Distance:", myScript.minDistance);
            myScript.maxDistance = EditorGUILayout.FloatField("Max Distance:", myScript.maxDistance);
            break;

        case RowCreatorOptions.fixedDistanceWithHeightVariation:
            myScript.distance  = EditorGUILayout.FloatField("Distance:", myScript.distance);
            myScript.yVariance = EditorGUILayout.FloatField("yVariance:", myScript.yVariance);
            break;

        case RowCreatorOptions.variableDistanceWithHeightVariation:
            myScript.minDistance = EditorGUILayout.FloatField("Min Distance:", myScript.minDistance);
            myScript.maxDistance = EditorGUILayout.FloatField("Max Distance:", myScript.maxDistance);
            myScript.yVariance   = EditorGUILayout.FloatField("yVariance:", myScript.yVariance);
            break;
        }

        //Draw Sprite List
        EditorGUILayout.PropertyField(gameObjectToBeCreated, true);

        if (GUILayout.Button("Create Sprites"))
        {
            myScript.CreateSprites();
        }

        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(myScript);
    }