Example #1
0
    /// <summary>
    /// Adds the gizmo.
    /// </summary>
    /// <param name="gizmoColor">Gizmo color.</param>
    /// <param name="transparency">Transparency.</param>
    /// <param name="type">Type. 0 = Cube | 1 = Sphere | 2 = Collider | 3 = Wire Cube | 4 = Wire Sphere </param>
    static void AddGizmo(Color gizmoColor, float transparency, float radius, int type)
    {
        recentGO.AddComponent <QuickGizmo> ();
        QuickGizmo gizmo = recentGO.GetComponent <QuickGizmo> ();

        UnityEditorInternal.ComponentUtility.MoveComponentUp(gizmo);

        switch (type)
        {
        case 0:
            gizmo.gizmoType = QuickGizmo.currentGizmoType.cube;
            break;

        case 1:
            gizmo.gizmoType = QuickGizmo.currentGizmoType.sphere;
            break;

        case 2:
            gizmo.gizmoType = QuickGizmo.currentGizmoType.collider;
            break;

        case 3:
            gizmo.gizmoType = QuickGizmo.currentGizmoType.wireframeCube;
            break;

        case 4:
            gizmo.gizmoType = QuickGizmo.currentGizmoType.wireframeSphere;
            break;
        }

        gizmo.gizmoColor   = gizmoColor;
        gizmo.gizmoColor.a = transparency;
        gizmo.gizmoRadius  = radius;
    }
Example #2
0
    void SetGizmo(QuickGizmo gizmo)
    {
        Color newColor = Color.cyan;

        gizmo.gizmoColor   = newColor;
        gizmo.gizmoColor.a = 0.4f;
        gizmo.gizmoType    = QuickGizmo.currentGizmoType.sphere;
        gizmo.gizmoRadius  = 0.4f;
    }
Example #3
0
    void SetSpawnPointGizmo(QuickGizmo spGizmo)
    {
        Color spColor = new Color32(77, 147, 217, 255);

        spGizmo.gizmoColor   = spColor;
        spGizmo.gizmoColor.a = 0.4f;
        spGizmo.gizmoType    = QuickGizmo.currentGizmoType.cube;
        spGizmo.gizmoRadius  = 0.5f;
    }
Example #4
0
 void OnEnable()
 {
     _quickGizmo         = (MonoBehaviour)target as QuickGizmo;
     gizmoType           = serializedObject.FindProperty("gizmoType");
     gizmoMesh           = serializedObject.FindProperty("mesh");
     gizmoColor          = serializedObject.FindProperty("gizmoColor");
     gizmoRadius         = serializedObject.FindProperty("gizmoRadius");
     gizmoTarget         = serializedObject.FindProperty("target");
     gizmoCustomCollider = serializedObject.FindProperty("chosenCollider");
     hideBool            = serializedObject.FindProperty("hideWhenNotSelected");
 }