public override void OnInspectorGUI()
    {
        style = new GUIStyle(GUI.skin.textArea);
        //style.fontStyle = FontStyle.Bold;
        //style.border = GUI.skin.label.border;
        //style.normal = GUI.skin.label.normal;
        style.margin.top    = 12;
        style.margin.bottom = 6;

        //DrawDefaultInspector();
        base.OnInspectorGUI();

        GUILayout.TextArea("In order to edit your material properly, please follow the two steps below. First, assign material to the projector. Edit your material as you want, and then update all material instances in the Scene.", style);

        AuraController myScript = (AuraController)target;

        if (GUILayout.Button("Step 1: Assign Source Material"))
        {
            myScript.AssignSourceMaterial();
        }

        if (GUILayout.Button("Step 2: Update all Material Instances"))
        {
            myScript.UpdateAllMaterialInstances();
        }
    }
示例#2
0
    protected override void Initiate()
    {
        HashSet <GameObject> gameObjects = PlayerDatabase.Instance.GetObjects(base.player);

        foreach (GameObject go in gameObjects)
        {
            if (go.layer == (int)ObjectLayers.Ship)
            {
                if (go.GetComponent <ShipController>().shipType == ShipType.MotherShip)
                {
                    AuraController auraController = go.AddComponent <AuraController>();
                    auraController.level        = 1;
                    auraController.modifierType = ModifierType.ShipHPRegen;
                    auraController.Radius       = 20f;
                    break;
                }
            }
        }
    }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     myManager = GetComponent <AuraController>();
     myColor   = myManager.myColor;
 }
 public void Start()
 {
     auraController = GetComponent <AuraController>();
 }